XDC - v. 0.6.1

net.sf.xdc.util
Class XPathUtils

java.lang.Object
  extended bynet.sf.xdc.util.XPathUtils

public class XPathUtils
extends java.lang.Object

The XPathUtils class contains a few utility methods used for selecting subnodes from a DOM node by an XPath expression.

Since:
0.6
Version:
0.6
Author:
Jens Voß

Method Summary
static org.w3c.dom.Node selectNode(org.w3c.dom.Node node, java.lang.String xPath)
          This method retrieves the single subnode of the given DOM Node which satisfies the specified XPath pattern.
static org.w3c.dom.traversal.NodeIterator selectNodes(org.w3c.dom.Node node, java.lang.String xPath)
          This method retrieves a NodeIterator which iterates over all subnodes of a given DOM node satisfying the specified XPath pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

selectNodes

public static org.w3c.dom.traversal.NodeIterator selectNodes(org.w3c.dom.Node node,
                                                             java.lang.String xPath)
                                                      throws javax.xml.transform.TransformerException
This method retrieves a NodeIterator which iterates over all subnodes of a given DOM node satisfying the specified XPath pattern.

Parameters:
node - The DOM node to which the XPath pattern is applied
xPath - The XPath expression applied to the DOM node
Returns:
A NodeIterator over all of the specified DOM node's subnodes satisfying the specified XPath expression
Throws:
javax.xml.transform.TransformerException

selectNode

public static org.w3c.dom.Node selectNode(org.w3c.dom.Node node,
                                          java.lang.String xPath)
                                   throws javax.xml.transform.TransformerException
This method retrieves the single subnode of the given DOM Node which satisfies the specified XPath pattern.

Parameters:
node - The DOM node to which the XPath pattern is applied
xPath - The XPath expression applied to the DOM node
Returns:
The single subnode of the specified DOM node satisfying the specified XPath expression
Throws:
javax.xml.transform.TransformerException

XDC - v. 0.6.1