The applyXPathToUrl function uses an XPath query to extract XML data from a specified URL. The function returns an XML fragment that lists the nodes that result from the query.
Syntax
sXML = applyXPathToUrl(url, xpathQuery, namespaceAware, returnArray)
Arguments
Defines the URL of the XML document on which to run the XPath.
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 an XML fragment that lists the nodes. For example:
sXML = applyXPathToUrl("http://localhost:8080/itpam_tutorials/book.xml", "/bookstore/book[2]", true, false);
If you set the returnArray argument to true, the query returns a C2OValueArray in which each element is an XML fragment for a node. For example:
sXMLArray = applyXPathToUrl("http://localhost:8080/itpam_tutorials/book.xml", "/bookstore/book", true, true);
|
Copyright © 2014 CA.
All rights reserved.
|
|