XML Load

image_pdfimage_print

This load is used to write a tabular-based data source to an XML file. The data source and XML elements are matched by the following criteria:

  • Elements have the same name (regardless of namespace).
  • All attributes defined in the source document element are present in the target document element and have the same attribute values.
Main settings

Data source

The component that provides the data to the load.

Target connection

The connection details of the target system.

Mode

In all modes except “create”, an XML element of the generated (source) document is matched to an already existing (target) document. If the XML file does not yet exist, it is created in all modes.

 

create:

Creates a new XML file, and deletes an existing XML file.

 

update:

Finds all elements matching root in source document and in target element. Removes all children of all target elements. Adds all children of all source elements as new children for all target elements.

 

add:

Finds all elements matching XPath root expression (root) in source document and in target element. Adds all children of all source elements as new children for all target elements.

 

insert:

Finds all elements matching root in source document and in target element. Adds children of all source elements as new children for all target elements if they do not having at least one matching child yet.

 

delete:

Finds all elements matching root in source document and in target element. Removes children of all target elements if they match a child of any source element.

XPath root expression

This is an absolute XPath expression that specifies the root nodes under which the source data is written in the XML file. Only simple XPath expressions with element names concatenated with “/” are supported. 

Example: /project/connections

XML mapping

The output is defined with a list of column definitions that contain the following elements: 

XPath expression

Defines the XML element relative to the XPath root expression.

Input

Reference to a source column or a constant value.

Advanced settings

Default namespace

If set, this default namespace is applied in the XML file.

Always generate

If checked, then a new root element is generated for each row.

If not checked, then all consolidated elements will be together under one root element.

To select particular rows to be generated as individual root elements,  then specify each row name with the qualifier @. The remaining rows will be put together as a single element.

Do not generate empty file

If checked, rows that do not contain data will not generate an element.

If not checked, such rows will generate an element with null value.

Notes
  • If no columns are defined, the XML load will create a simple XML output in a fixed tabular format using the tags <data>, <row> and <value>. In this case only the “create” and “add” modes are supported, and no XPath root expression can be defined.
  • If the XMLFile connection contains a XSD schema file, it will be used to generate the XML document.
image_pdfimage_print