Class XPathUtils


  • public class XPathUtils
    extends java.lang.Object
    A XPathUtils ...
    Author:
    Matthew J. Duftler (duftler@us.ibm.com), Sanjiva Weerawarana (sanjiva@watson.ibm.com)
    • Constructor Summary

      Constructors 
      Constructor Description
      XPathUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getXPathExprFromNode​(org.w3c.dom.Node node)
      Generates an XPath expression that will return only the given node as its result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XPathUtils

        public XPathUtils()
    • Method Detail

      • getXPathExprFromNode

        public static java.lang.String getXPathExprFromNode​(org.w3c.dom.Node node)
                                                     throws java.lang.IllegalArgumentException
        Generates an XPath expression that will return only the given node as its result. This method only works for element, text, document and PI nodes.
        Parameters:
        node - the node to generate an XPath expression for. This node must be an element node, a text node, a document node, or a processing instruction node.
        Returns:
        an XPath expression that will return only the given node as its result.
        Throws:
        java.lang.IllegalArgumentException - if the given node is not an element, text, document or PI node.