Cisco Cisco Process Orchestrator 2.X User Guide

Page of 828
 
A-62
Cisco Tidal Enterprise Orchestrator Reference Guide
OL-24928-01
Appendix A      Managing Core Activities
  Managing Core Activity Definitions
XPath Example Syntax
The following path expressions can be used when selecting nodes in a path expression of a XPath query. 
XPath Query Example
The following is an example of XML query code. 
Note
For additional examples, see 
.
The following are example path expressions and related results based on the 
Path Expression
Description
nodename 
Selects all child nodes of the named node 
/
Selects from the root node 
//
Selects nodes in the document from the current node that 
match the selection no matter where they are located
.
Selects the current node 
..
Selects the parent of the current node
@
Selects attributes
Example XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>
<book>
  <title lang="eng">Learning XML</title>
  <price>39.95</price>
</book>
</bookstore>
Path Expression
Description
bookstore
Selects all child nodes of the bookstore element 
/bookstore
Selects the root element bookstore
Note
If the path starts with a slash ( / ) it always 
represents an absolute path to an element.
bookstore/book
Selects all book elements that are children of bookstore
//book
Selects all book elements no matter where they are in the 
document