Android XML InputStream Parse getDocument(InputStream is)

Here you can find the source of getDocument(InputStream is)

Description

get Document

Declaration

public static Document getDocument(InputStream is)
            throws ParserConfigurationException, SAXException, IOException 

Method Source Code

//package com.java2s;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;

public class Main {
    public static Document getDocument(InputStream is)
            throws ParserConfigurationException, SAXException, IOException {
        DocumentBuilderFactory domfactory = DocumentBuilderFactory
                .newInstance();//w w w.j  av a  2  s.com
        domfactory.setNamespaceAware(true); // never forget this!
        DocumentBuilder builder = domfactory.newDocumentBuilder();
        Document doc = builder.parse(is);
        return doc;
    }
}

Related

  1. readSetXml(InputStream in)
  2. readSetXml(InputStream in)
  3. readSetXml(InputStream in)
  4. InputStreamToDocument(InputStream istr)
  5. LoadXml(InputStream stream)
  6. getPullParser(InputStream in, String encoding)
  7. newPullParser(InputStream input)
  8. obtainEncodingStringFromInputStream(InputStream bis)
  9. parse(InputStream in, ContentHandler handler)