List of usage examples for org.apache.commons.io.input XmlStreamReader XmlStreamReader
public XmlStreamReader(InputStream is, String httpContentType) throws IOException
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)); }