XPath.execute()
Signature
String execute (String xpath, String xml, String prefixes)
Domain
action, condition, query
Description
Evaluate an XPath Expression against the input XML String.
Parameters
Name | Type | Description |
xpath | String | The XPath expression. $var is required in front of the root element, for example: "count($var/order/orderlines)". |
xml | String | The XML string for the xpath to be executed on. |
prefixes | String | The prefixes and namespaces in comma delimiter format, for example: "xns1=http://www.tibco.com/be,xns2=http://www.tibco.com/support". |
Returns
Type | Description |
String | The result of the evaluation. |
Cautions
RuntimeException for an undefined property.
Example
String xpath = "$var/xns:fileLocation/xns:hostname/text()";
String xml = "hostNameWithNamespacefile.txt"
String prefix = "xns=http://www.tibco.com";
XPath.execute(xpath, xml, prefix) returns "localhost"