Example usage for org.apache.commons.io.input XmlStreamReader XmlStreamReader

List of usage examples for org.apache.commons.io.input XmlStreamReader XmlStreamReader

Introduction

In this page you can find the example usage for org.apache.commons.io.input XmlStreamReader XmlStreamReader.

Prototype

public XmlStreamReader(InputStream is, String httpContentType) throws IOException 

Source Link

Document

Creates a Reader using an InputStream an the associated content-type header.

Usage

From source file:com.c4om.jschematronvalidator.JSchematronValidatorMain.java

/**
 * Reads a {@link org.w3c.dom.Document} from an {@link InputStream}. Encoding is automatically 
 * determined as specified by corresponding RFCs.
 * @param is the input stream./*from  ww  w.j a v  a 2s  .co m*/
 * @return the read {@link Document}
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws IOException
 */
public static Document loadW3CDocumentFromInputStream(InputStream is)
        throws ParserConfigurationException, SAXException, IOException {
    Reader xmlStreamReader = new XmlStreamReader(is, true);
    return loadW3CDocumentFromInputSource(new InputSource(xmlStreamReader));
}