Package gda.util.xml

Class XmlUtils

java.lang.Object
gda.util.xml.XmlUtils

public class XmlUtils extends Object
Utility methods for working with XML documents.
  • Constructor Details

    • XmlUtils

      public XmlUtils()
  • Method Details

    • readXmlDocument

      public static String readXmlDocument(URL url) throws IOException
      Reads the XML document and returns it as a String.
      Parameters:
      url - the URL of the XML document
      Returns:
      the XML document, as a String
      Throws:
      IOException
    • readXmlDocument

      public static String readXmlDocument(InputSource source) throws IOException
      Reads an XML document and returns it as a String.
      Parameters:
      source - the input source for the XML document
      Returns:
      the XML document, as a String
      Throws:
      IOException
    • filterXml

      public static InputSource filterXml(InputSource source, XMLFilter filter) throws Exception
      Filters an XML document.
      Parameters:
      source - the input source for the XML document
      filter - the filter
      Returns:
      an input source for the resulting document
      Throws:
      Exception
    • stringInputSource

      public static InputSource stringInputSource(String xml)
      Creates an InputSource for the XML document in the given String.
      Parameters:
      xml - the XML document as a String
      Returns:
      an input source for the XML document