XPath Query

This activity allows you to extract information from an XML-formatted string. Instead of using regular expression to parse the XML, you can use an XPath to traverse the XML structure and extract the data you want.

Note: Some XML contains namespaces to help describe the content. The XPath Query activity can be configured to recognize namespaces by adding them under the Namespaces section in its properties.

Usage

Complete the following properties to use this activity:

  • XML Query
    • Source XML to Query - Paste the XML content into the text box or click the Variable Reference icon to choose a variable.
  • Namespaces - Click Add and provide the following information:
    • Prefix - Enter the element name prefix.
    • URI - Enter the URI associated with the prefix.
  • XPath Queries - Click Add and provide the following information:
    • Property Name - Enter the name of the XML property.
    • XPath Query - Enter the query or click the Variable Reference icon to use a variable.
    • Property Type - Click the drop-down menu and choose the type of property the query will search for.

Sample Workflows

The following sample workflows are available in our repository’s workflows folder to help you get familiar with this concept. These can be imported using the instructions in Import Git Content or you can click the workflow to view it in GitHub.