Class XmlUtils


  • public class XmlUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.w3c.dom.Document getXmlDocument​(java.io.InputStream in)
      Parses XML contained in the input stream
      static org.w3c.dom.Document getXmlDocument​(java.lang.String xmlBody)
      Parses XML contained in a String
      • Methods inherited from class java.lang.Object

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

      • getXmlDocument

        public static org.w3c.dom.Document getXmlDocument​(java.lang.String xmlBody)
        Parses XML contained in a String
        Parameters:
        xmlBody - an XML content.
        Returns:
        a parsed document representing xmlBody.
        Throws:
        java.lang.IllegalArgumentException - when the xmlBody does not contain a well formed XML.
      • getXmlDocument

        public static org.w3c.dom.Document getXmlDocument​(java.io.InputStream in)
        Parses XML contained in the input stream
        Parameters:
        in - an input stream to read XML content from.
        Returns:
        a parsed document representing the XML in the input stream.
        Throws:
        java.lang.IllegalArgumentException - when the input stream failed to read or does not contain a well formed XML.