Package gda.util.xml
Class XmlUtils
java.lang.Object
gda.util.xml.XmlUtils
Utility methods for working with XML documents.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputSourcefilterXml(InputSource source, XMLFilter filter) Filters an XML document.static StringreadXmlDocument(URL url) Reads the XML document and returns it as aString.static StringreadXmlDocument(InputSource source) Reads an XML document and returns it as aString.static InputSourcestringInputSource(String xml) Creates anInputSourcefor the XML document in the givenString.
-
Constructor Details
-
XmlUtils
public XmlUtils()
-
-
Method Details
-
readXmlDocument
Reads the XML document and returns it as aString.- Parameters:
url- the URL of the XML document- Returns:
- the XML document, as a
String - Throws:
IOException
-
readXmlDocument
Reads an XML document and returns it as aString.- Parameters:
source- the input source for the XML document- Returns:
- the XML document, as a
String - Throws:
IOException
-
filterXml
Filters an XML document.- Parameters:
source- the input source for the XML documentfilter- the filter- Returns:
- an input source for the resulting document
- Throws:
Exception
-
stringInputSource
Creates anInputSourcefor the XML document in the givenString.- Parameters:
xml- the XML document as aString- Returns:
- an input source for the XML document
-