The applyPath function uses an XPath query to extract XML data and returns an XML fragment that lists the nodes that result from the query.
Syntax
sXML = applyXPath(xmlData, xpathQuery, namespaceAware, returnArray)
Arguments
Defines the XML on which to run the XPath query.
Defines the XPath query to run.
(Optional) Specifies whether to strip name spaces before applying the XPath query.
True: CA Process Automation does not strip name spaces before applying the XPath query.
False: CA Process Automation strips name spaces before applying the XPath query, making the query simple.
Default: True
(Optional) Specifies whether to return an array of results or a single string.
True: The function returns an array of results.
False: The function returns a single string with multiple results concatenated in the string.
Default: False
Note: If the XPath query does not find a match, it returns a blank array.
Return Values and Examples
One of the following return values, based on the value of the returnArray argument.
If you omit the returnArray argument or you set it to false, the query returns this value. The value that returns is an XML fragment that lists the nodes. For example:
Process.xpathResult = applyXPath(Process.bookXML, "/bookstore/book[2]", true, false);
If you set the returnArray argument to true, the query returns this value. The value that returns is a C2OValueArray in which each element is an XML fragment for a node. For example:
Process.xpathArrayResult = applyXPath(Process.bookXML, "/bookstore/book", true, true);
|
Copyright © 2014 CA.
All rights reserved.
|
|