CWM_XPath is a built-in for CWM that allows CWM to evaluate XPath expressions and select nodes from XML. Implements the functions: selectSingleNode, selectNodes, and evaluate.
Subject: A two-item list containing XML text and an XPath expression. Object: The text of the first node selected by the XPath expression. If the node has child nodes, the text of all child nodes is concatenated and returned. use: ("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item") xpath:selectSingleNode :node . Result: "Book"
("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item") xpath:selectSingleNode :node .
Subject: A two-item list containing XML text and an XPath expression. Object: A list of strings representing the text of the nodes selected by the XPath expression. use: ("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item") xpath:selectNodes :nodes . Result: ( "Book", "Pen" )
("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item") xpath:selectNodes :nodes .
Subject: A two-item list containing XML text and an XPath expression. Object: A number or string that is the result of evaluating the XPath expression. use: ("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item") xpath:evaluate :value . Result: 2
("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item") xpath:evaluate :value .
Copyright© 2003-2005 Waleed Abdulla, All Rights Reserved.