Get a value from using xpath expression

Last published at: May 2nd, 2023

Description:

Get a value from using XPath expression

Inputs

  • attributeName– name of the attribute
  • variableToStoreValue - variable to store the value
  • xmlVariable - variable that holds the xml
  • xPathExpression - xpath expression to use 

Returns

  • True – True condition
  • False – False condition 

Usage:

Example:

Let’s build and execute the getXPathValueDef example.          

  • Create a new definition called “getXPathValueDef
  • Select the definition and click the “design” button
  • Drag updateVariables, getXPathValue steps from the toolbox
  • Connect the steps as shown below

  • Click on the “updateVariables” step to configure its properties as shown below. Define a variable and initialize with XML data.

  • Sample XML data for reference
<root>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</root>
  • Click on the “getXPathValue” step to configure its properties as shown below

  • Save the process definition, create a new process instance and execute. The step should get the value from XPath.

Click on the valueXpath step to view the variables / properties information in a new tab.