XML Load

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.

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.
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.

XML load with REST connection

If you use a connection type REST to send a RESTful request to an external API endpoint within an Integrator execution, the REST connection must use HTTP method POST, PUT, or DELETE. The data may be static or filled dynamically during the load.

Dynamic data: in this case, the request body of the REST connection is filled dynamically during the load with the XML data generated by the XML load. Therefore, the REST connection must have an empty request body in its definition.

Static data: in this case, the XML load must not have a data source assigned. The XML load simply executes the HTTP call as defined in the REST connection.

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.
  • On the XPath root expression level, the XSD should contain an attribute that carries the primary key information. In the XML mapping definition of the Load, this attribute must be assigned to one input. Only in this case are all source rows written to the XML file in separate tags.

Updated January 29, 2024