Class XMLExtUtils


  • public class XMLExtUtils
    extends java.lang.Object
    Utility class that can be used to perform an XPath evaluation on an XML Document or Element to retrieve a matching Node or NodeList.
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLExtUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.w3c.dom.Node getNode​(java.lang.String xpath, org.w3c.dom.Document doc)
      Method evaluates an xpath expression on the given XML Document and returns the matched node.
      static org.w3c.dom.Node getNode​(java.lang.String xpath, org.w3c.dom.Element elem)
      Method evaluates an xpath expression on the given XML Element and returns the matched node.
      static org.w3c.dom.NodeList getNodes​(java.lang.String xpath, org.w3c.dom.Document doc)
      Method evaluates an xpath expression on the given XML Document and returns a list of matched nodes.
      static org.w3c.dom.NodeList getNodes​(java.lang.String xpath, org.w3c.dom.Element elem)
      Method evaluates an xpath expression on the given XML Element and returns a list of matched nodes.
      • Methods inherited from class java.lang.Object

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

      • XMLExtUtils

        public XMLExtUtils()
    • Method Detail

      • getNode

        public static org.w3c.dom.Node getNode​(java.lang.String xpath,
                                               org.w3c.dom.Element elem)
        Method evaluates an xpath expression on the given XML Element and returns the matched node.
        Parameters:
        xpath - XPath expression used to find the Nodes.
        elem - XML Element object to query
        Returns:
        Node. If an exception is encountered, return null.
      • getNode

        public static org.w3c.dom.Node getNode​(java.lang.String xpath,
                                               org.w3c.dom.Document doc)
        Method evaluates an xpath expression on the given XML Document and returns the matched node.
        Parameters:
        xpath - XPath expression used to find the Nodes.
        doc - XML Document object to query
        Returns:
        Node. If an exception is encountered, return null.
      • getNodes

        public static org.w3c.dom.NodeList getNodes​(java.lang.String xpath,
                                                    org.w3c.dom.Element elem)
        Method evaluates an xpath expression on the given XML Element and returns a list of matched nodes.
        Parameters:
        xpath - XPath expression used to find the Nodes.
        elem - XML Element object to query
        Returns:
        NodeList. If an exception is encountered, return null.
      • getNodes

        public static org.w3c.dom.NodeList getNodes​(java.lang.String xpath,
                                                    org.w3c.dom.Document doc)
        Method evaluates an xpath expression on the given XML Document and returns a list of matched nodes.
        Parameters:
        xpath - XPath expression used to find the Nodes.
        doc - XML Document object to query
        Returns:
        NodeList. If an exception is encountered, return null.