Object
zXPath
The zXPath
class is used to perform cross-browser XPath evaluations
on DOM documents.
This class equalizes the differences between Internet Explorer and Mozilla implementations (other browsers don't support JavaScript-based XPath).
Nicholas C. Zakas, http://www.nczonline.net/
1.0
1.0
static Array |
selectNodes(Node
oRefNode, String sXPath) Returns all nodes matching the XPath expression. |
static Array |
selectNodes(Node
oRefNode, String sXPath, Object oXmlNs) Returns all nodes matching the XPath expression. |
static Node |
selectSingleNode(Node
oRefNode, String sXPath) Gets the first node matching the XPath expression. |
static Node |
selectSingleNode(Node
oRefNode, String sXPath, Object oXmlNs) Gets the first node matching the XPath expression. |
public static Array selectNodes(Node oRefNode, String sXPath)
Returns all nodes matching the XPath expression.
oRefNode
- The reference node for the XPath evaluation.sXPath
- The XPath expression to run.An array containing all nodes that match the XPath expression (an empty array if no matches are found).
public static Array selectNodes(Node oRefNode, String sXPath, Object
oXmlNs)
Returns all nodes matching the XPath expression.
oRefNode
- The reference node for the XPath evaluation.sXPath
- The XPath expression to run.oXmlNs
- The XML namespaces used in the XPath expression.An array containing all nodes that match the XPath expression (an empty array if no matches are found).
public static Node selectNodes(Node oRefNode, String sXPath)
Returns the first node matching the XPath expression.
oRefNode
- The reference node for the XPath evaluation.sXPath
- The XPath expression to run.The first node matching the XPath expression.
public static Node selectSingleNode(Node oRefNode, String sXPath, Object
oXmlNs)
Returns the first node matching the XPath expression.
oRefNode
- The reference node for the XPath evaluation.sXPath
- The XPath expression to run.oXmlNs
- The XML namespaces used in the XPath expression.The first node matching the XPath expression.