Skip to main content
Skip table of contents

XPath Iterator

This adapter selects a node set, a node or node content using an XPath expression in an input XML document, and outputs a node set as XML document or values as text document. The adapter can either iterate through all matching nodes and output the results successively (ForEach loop) or it can output the result of the first match.

If you define several XPath Iterators within one process context, it is required to assign an explicit ID for the corresponding adapter within the parameter Id, e.g. 1001, 1002 etc. Thus, it is ensured that only the XPath Iterator with the corresponding ID will be affected (see operation Clear) when selecting or resetting the iterator in the forEach mode.

If the default value of the parameter Id remains on 0, the ID is equivalent to the process step number (action ID) in the current process. This ID may not be unique, if an XPath Iterator with the same action ID is used in a subprocess.

Properties

Operation

Defines the operation executed by the function adapter

Possible values:

  • Select: Apply XPath expression to the input XML document and output a result document (consider parameter Id)

  • Clear: Reset an XPath Iterator's iterator having the same ID as the XPath Iterator using the operation Select (see parameter Id)

Parameters

Adapter

Main adapter class (do not change!)

Possible values: de.softproject.integration.adapter. xpathselector.XPathSelector: Main class (default)

XPath

XPath expression applied to the input XML document

Possible values: Any XPath expression (e.g. /Element[@att="Value"]/text())

forEach

Select the first node or all matching nodes

Possible values:

  • true: Iterate through all selected nodes and output a document in each case, useful in combination with a Condition process component (default)

  • false: Output first match

Id

Unique ID of the XPath Iterator component within the process context or within the process instance (when using several independently iterating XPath Iterators within the same process context)

Possible values:

  • 0: Use current action ID (process step number of the XPath Iterator in the current process) as ID; Please note that an XPath Iterator in a subprocess could have the same action ID (default)

  • Any integer number except 0 in order to identify the XPath Iterator component within the process context; Recommendation: use a value >1000 in order to avoid catching an already existing action ID

Status values

-1 (error)

Error when executing the adapter (for details, see the server log)

0 (empty)

The adapter doesn't output data (anymore). In the iterator mode, this status can be used as stop criterion of a loop within the Technical Process. It indicates that no further data row is available.

1 (successful)

The adapter outputs a result. In the iterator mode, this status can be used as condition to enter a loop within the Technical Process. It indicates that further data row is available.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.