Java Utililty Methods XML Parse Stream

List of utility methods to do XML Parse Stream

Description

The list of methods to do XML Parse Stream are organized into topic(s).

Method

NodeparseXml(InputStream src)
parse Xml
if (src == null) {
    return null;
return parseXml(new InputSource(src));
DocumentparseXMLFromStream(InputStream stream)
Parses XML from an input stream.
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(stream);
stream.close();
return document;
DocumentparseXmlInputStream(InputStream inputStream)
parse Xml Input Stream
Document document = null;
try {
    document = getDocumentBuilder().parse(inputStream);
    inputStream.close();
} catch (IOException e) {
    throw new RuntimeException("could not read xml stream", e);
} catch (SAXException e) {
    throw new RuntimeException("could not parse xml document", e);
...
DocumentparseXmlInputStream(InputStream inputStream)
parse Xml Input Stream
Document document = null;
try {
    document = getDocumentBuilder().parse(inputStream);
} catch (Exception e) {
    throw new RuntimeException("couldn't parse xml", e);
return document;
DocumentparseXMLResource(final InputStream inputStream)
Parses Input Stream and returns XML document.
DocumentBuilder docBuilder;
Document doc = null;
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setIgnoringElementContentWhitespace(true);
docBuilder = docBuilderFactory.newDocumentBuilder();
doc = docBuilder.parse(inputStream);
return doc;