18.2. Usage

In the 'File' tab you can load an XML file into the component by clicking on the "Load... " button and navigating to the file of your choice. The content of the XML file will be stored within the workflow and is shown in the text box below so you can quickly verify that you chose the correct file:

Note

Changing the file itself does not change the loaded content. You have to load the file again to apply changes.

18.2.1. Writing values into an XML file

To map single values into the XML dataset you have to add one input channel per value to be mapped. If you require more complex or conditional mappings or transformations please refer to the XML Merger component. In the "Add Input" dialog click "XPath choosing... " and navigate to an XML file with the same structure as the one you referenced in the 'File' tab, preferably the same file. In the appearing "XPath Variables Dialog" window navigate along the tree to the node you desire to change and select it.

Note

Search for the XPathChooser help in the User Guide (3. Usage -> 2. Workflows -> 2.3 Workflow components) to garner further information about the usage of XPaths.

When the component is executed the value being received on this input channel will be written to the XPath location defined here. The resulting XML file with the inserted values is written to the output "XML". You can check the original and the outgoing XML files in the workflow data browser.

18.2.2. Reading values from an XML file

To read single values from an XML file add a dynamic output. In the "Add Output" dialog click "XPath choosing... " and navigate to an XML file with the same structure as the one you referenced in the 'File' tab, preferably the same file. In the appearing "XPath Variables Dialog" window navigate along the tree to the node you desire to read and select it. When the component is executed the content of the node that the XPath points to is written into the output channel.