XML Peek
Last updated
Last updated
The XMLPeek function allows one or more XML nodes to be read from an XML document.
XML source controls where the function reads the input XML from, and must be one of the following values:
File Reads from the XML file defined in the property
String Reads from an XML formatted string defined in the property.
The path to an XML file which will be read by the function.
This property is only displayed if is set to "File".
The XML formatted string to read.
This property is only displayed if is set to "String".
XPath is a string conforming to the format. It is used to select which nodes are read by the function.
Namespaces should be defined in the format [prefix]="[URI]".
Multiple definitions should be separated by a space.
Output controls how the nodes matched by Xpath are returned from the functions. Output can be set to one of the following values:
Loop nodes The function will return the contents of each matched node one item at a time. On the design canvas you will see a "ForEachNode" loop icon as a child of this function. Any function added to the loop will be able to access the contents of the node in an output variable named "Node".
List of nodes The function will produce a list containing the contents of all matching nodes.
Single node The function will provide as output the contents of the first matched node. If more than one node is matched by XPath, only the first one is returned. If no matching nodes are found, an exception is thrown.
Single node or empty The function will provide as output the contents of the first matched node, if one was found. If more than one node is matched by XPath, only the first one is returned. If no matching nodes are found, the output will contain an empty string.
Data is stored in the following variables:
When Output is 'List of nodes':
XMLPeek (List <String>)
When Output is 'Single node' or 'Single node or empty':
XMLPeek (String)
When Output is 'Loop nodes':
XMLPeekForEachNode
Index (Int32)
String (String)
An optional string defining any for prefixes used in the property.