Previous Topic: adjustResourceValsNext Topic: applyXPathToUrl


applyXPath

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

xmlData (String)

Defines the XML on which to run the XPath query.

xpathQuery (String)

Defines the XPath query to run.

namespaceAware (Boolean)

(Optional) Specifies whether to strip name spaces before applying the XPath query.

Values:

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

returnArray (Boolean)

(Optional) Specifies whether to return an array of results or a single string.

Values:

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.