XML/XPath Transfer Object
XML transfer objects are available as sources and destinations. XPath queries can be used to extract elements from XML files or write them to XML files. No plug-in configuration is necessary; you can configure the transfer object directly within the flow as described.
After double-clicking the transfer object, set the following properties:
Section: XPath Elements
| Property | Description |
|---|---|
| Name | The name under which the query appears in the transfer object. |
| XPath Expression | Valid XPath query; in the simplest case, the path to the node (see below) |
| XML Mode | Specifies whether only the content of the query result or also the enclosing tag will be output (e.g., Heinrich Mann or <autor>Heinrich Mann</autor>). When writing to the object (generating XML), “Inner XML” must always be specified because the structure is already fixed. |
XPath Placeholders
| Property | Description |
|---|---|
| Parameter Name | Name of the placeholder |
| Default Value | Default value of the placeholder |
Section: Namespaces and Prefixes
| Property | Description |
|---|---|
| Prefix | Unique prefix |
| Namespace | Namespace |
When the XML code is parsed at design time, all existing namespaces are entered. Use the checkbox to select the namespace that should be used as the default for XPath queries. If a default is defined, formulate the XPath queries without the prefix; it will be added automatically. However, you must specify the prefixes in the source code.
Section: XML Code
The multi-line field is used to enter XML code. At design time, you can use it to test your XPath expressions. You can then delete the code again if you pass the XML code dynamically at runtime (transfer object as source) or generate it at runtime (transfer object as destination). Of course, you can also leave static code here if that meets your requirements.