XmlToXls Step

Use this step to convert XML data to XLS file

Last published at: May 14th, 2024

Description:

This step converts the XML data to XLS file 

Inputs

  • xmlVariable – variable / global that holds the xml data
  • xlsFilePath – variable / global that holds the output file path on the server 
  • xmlNodeName – mention XML node to parse or considers the xml data between <root> and <\root> tags to parse by default 
  • workSheetName - renames the worksheet with this name (not mandatory)
  • writeColHeadings - write column names (On / Off) 


Returns

  • True – step executed successfully
  • False – step failed to execute 


Usage: 


Example:

Let’s build and execute the XmlToXlsDef example.          

  • Create a new definition called “XmlToXlsDef
  • Select the definition and click the “design” button
  • Let’s define few string data type variables called “varXML” and “filePath”.
  • Drag a XmlToXls step to the canvas, connect to start step and configure its properties
  • Generate a new process instance. Initialize the varXML variable with the sample XML data shown below. The step shall process the raw XML data between the <root> <\root> elements or a specific node which is seen configured above in Advanced - XML nodes to be processed. This XML node can also refer to the root node (root) or specific node (node) in the XML data. Copy-paste the sample XML data to xmlVar variable to initialize. Typically, the varXML variable is initialized by other XML steps like (executesql, generatexml) in a process workflow. Execute this new process instance.
<root>
<node>
    <to>mike@email.com</to> 
    <from>flowwright@support.com</from> 
    <heading>New social handle</heading> 
    <body>Hi! We're here on Instagram now. Let's connect!</body> 
</node>
<book id='bk101'>
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
</book>
<node>
    <to>lowry@email.com</to> 
    <from>flowwright@support.com</from> 
    <heading>New social handle</heading> 
    <body>Hi! We're here on Instagram now. Let's connect!</body> 
</node>
</root>

  • The step shall transform the XML data to XLS file on the server. The default Sheet1 worksheet is renamed with the value (TestSample) as configured above. Use the appURI and filePath variable values from the step property to download the XLS file.