Class XmlHelper

java.lang.Object
com.github.hypfvieh.XmlHelper

public final class XmlHelper extends Object
Utility for various XML operations.
Author:
hypfvieh
  • Method Details

    • parseXmlString

      public static Document parseXmlString(String _xmlStr) throws IOException
      Create a new Document instance from the given string, disabling validation.
      Parameters:
      _xmlStr - xml string
      Returns:
      document, never null
      Throws:
      IOException - on error
    • applyXpathExpressionToDocument

      public static NodeList applyXpathExpressionToDocument(String _xpathExpression, Node _xmlDocumentOrNode) throws IOException
      Use an Xpath expression on the given node or document.
      Parameters:
      _xpathExpression - xpath expression string
      _xmlDocumentOrNode - a Document or Node object
      Returns:
      NodeList never null
      Throws:
      IOException - on error