Class XMLExtUtils

java.lang.Object
com.tivoli.am.fim.trustserver.sts.utilities.XMLExtUtils

public class XMLExtUtils extends 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 Details

    • XMLExtUtils

      public XMLExtUtils()
  • Method Details

    • getNode

      public static Node getNode(String xpath, 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 Node getNode(String xpath, 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 NodeList getNodes(String xpath, 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 NodeList getNodes(String xpath, 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.