Child pages
  • KB73059616: Automation Engine - How to define an XPath expression in an XPath SmartName
Skip to end of metadata
Go to start of metadata

Context

XPath uses path expressions to select nodes or node-sets in an XML document.

These nodes:

  • Have no value defined.
  • Can have a different position in the XML file each time.

XPath expressions can extract an attribute value from another attribute in the same string.

Procedure

E.g. In the following XML file, you want to extract the attribute value att3 where the att1 value is bring:

<?xml version="1.0" encoding="UTF-8"?>
<parent>
<child att1="red" att2="green" att3="black" />
<child att1="car" att2="buss" att3="plane" />
<child att1="dog" att2="cat" att3="child" />
<child att1="bring" att2="jump" att3="walk" />
</parent>

 

To do so:

  1. Go to SmartName dialog.
  2. In the XPath expression to evaluate field, you enter: //parent/child[@att1='bring']/@att3

More information

For more information on XML and XPath expressions, go to http://www.w3schools.com

Article information
Applies to

Automation Engine all versions

Created05-Mar-13
Last revised19-May-16
AuthorANMO
CW Number 
Contents