OpenWGA 7.6 - TMLScript reference
WGA » WGA.XmlMethod :
xpathList(domobject, xpath [, namespaces])
On object | WGA.Xml |
Usage |
Executes an XPath expression on some XML text or JavaBean, returning a list |
Description |
This function always returns lists. If the xpath expression matches only a single values it will return it as single element in a list. If you only want to retrieve single values use xpath(). It accepts the following types of DOM object:
If your DOM contains nodes belonging to an XML namespace you will need to define prefixes for those namespaces by using argument "namespaces" and use those prefixes in the XPath expression on these nodes if you want to query them. For backward compatibility there still is a global function "xpathList()" available whose use is discouraged since OpenWGA 5.3. |
Parameters |
domobject (String, Java object): The DOM object on which the XPath is to be executed. See the description for valid types. xpath (String): XPath expression to execute namespaces (Lookup table, optional): Determines XML namespace prefixes to be used inside the XPath expression. Keys are prefixes, values are namespace URIs. The prefixes do not need to match prefixes that that may be present in the parsed XML. DOM elements that are specified in the XPath expression without prefixes determined here are regarded to be of the default namespace. |
Return value |
Variant 1: List of results of the expression, either the text of text nodes or attributes, or DOM4J node objects (org.dom4j.Node) Variant 2: List of custom values retrieved from the JavaBean |
Allowed in script types |
|