Import from XML File#

The Import from XML File allows users to import data directly from XML files, specifying the data sheets.

The Import from XML File task is divided into two tabs:


The Options tab#

The Options tab follows the structure shown in the Import Overview page.


The Xml Configuration tab#

The Xml Configuration tab is divided into three panes:

Parsing options

Within this pane, users can set and configure the following options:

  • Number separators: users can define symbols to mark thousands and decimals in numbers. You can select the symbols from the Thousands and Decimals drop-down lists.

  • Missing string: users can enter the string to remove from the dataset.

  • Key for types: users can specify the string to be used to identify the type.

Import options

Within this pane, users can find and set the following options:

  • Remove the most external tag when importing dataset: if selected, the most external tag is removed from the imported file.

  • Remove empty rows: if selected, it removes empty rows from the imported dataset.

  • Add group columns: If selected, it adds an extra column containing the group id or file structure.

  • Remove empty columns: if selected, it removes empty columns from the imported dataset.

  • Add an attribute containing filename: if selected, it adds an extra column with the name of the file to the dataset.

  • Strip spaces: if selected, it removes the empty columns from the imported dataset. For example, the string ” class ” will be imported as “class”.

  • Case sensitive:if selected, upper cases are considered different from lower cases.

  • Compress white spaces: if selected, it compresses contiguous occurrences of white spaces in one single occurrence. For example the string “university program” would be imported as “university program”.

  • Save response header: available in the Import from JSON File and in the Import from XML File tasks when importing from a Http Server, allows to save the response’s headers, by adding two extra columns to the dataset: one containing the headers’ names, and another one containing the headers’ values, so that each row contains the header name and its corresponding value.

  • Turn off smart type recognition: if selected, prevents automatic recognition of data types. This option is useful when manual identification is preferable, for example when there is the risk of a code being misinterpreted as a date.


Example#

  • Drag an Import from XML File task onto the stage.

  • Double-click to open the task.

  • Move the Source slider to Custom.

  • Select Local File System from the drop-down menu.

  • Click Select and browse to the file you want to import.

  • Configure, if needed, the options in the Xml Configuration tab as explained above.

  • Save and compute the task.

  • Click the Load Preview button to visualize a preview of the imported file in the Table preview pane.

  • According to the selected file, your Import from XML File task should look like the example provided below.

https://cdn.rulex.ai/docs/Factory/import_xml_ex.webp