xml-to-list (DEPRECATED)
This feature is deprecated. It was used actively in IM 1.18.x and older. It is kept now only for compatibility reasons.
This component is used for loading records from an XML file. The loaded records can be resent directly to another PFX component (e.g. dsLoad
) or can call an existing Camel endpoint. The attributes id
 and elementName
 are required.
Attributes | Description | Required? |
---|---|---|
| ID used for registering the component to CamelContext | yes |
| Name of a route where the component sends data after the load is done | no |
| Name of the XML element that should be converted into a record | yes |
| Size of the batch | no |
| Timeout | no |
| Name of a XSLT template which is used to transform the input XML document (before records are created) Input XML document is transformed using the given XSLT template before creating records. | no |
 The xml-to-list component works in batches. The default batch size is 5000 items, so while xml-to-list is called once, outputUri is called multiple times with batches of 5000 items.
Example:
<pfx:xml-to-list id="xmlExportCosts" elementName="product" outputUri="direct:convertedDataRoute"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="file://data-samples/data.xml"/>
<to uri="direct:xmlExportCosts"/>
<log message="Total input records count: ${header.PfxTotalInputRecordsCount}"/>
</route>
</camelContext>
Â
The above example works with the following input file (data.xml):
<products>
<product>
<sku>1</sku>
<company>Ford</company>
<price>10</price>
<vat>1</vat>
</product>
<product>
<sku>2</sku>
<company>Opel</company>
<price>20</price>
<vat>2</vat>
</product>
<product>
<sku>3</sku>
<company>BMW</company>
<price>30</price>
<vat>3</vat>
</product>
<product>
<sku>4</sku>
<company>Ford</company>
<price>40</price>
<vat>4</vat>
</product>
</products>
IntegrationManager version 5.8.0