Java XML Parse Stream parse(InputStream is)

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

Description

parse

License

GNU General Public License

Declaration

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

Method Source Code

//package com.java2s;
/* ***** BEGIN LICENSE BLOCK *****
 * Version: GPL 2.0/*from w w  w. j  ava  2s  . c  o  m*/
 *
 * The contents of this file are subject to the GNU General Public
 * License Version 2 or later (the "GPL").
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Initial Developer of the Original Code is
 *   MiniG.org project members
 *
 * ***** END LICENSE BLOCK ***** */

import java.io.IOException;
import java.io.InputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;

import org.xml.sax.SAXException;

public class Main {
    public static Document parse(InputStream is) throws SAXException,
            IOException, ParserConfigurationException,
            FactoryConfigurationError {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder builder = dbf.newDocumentBuilder();
        return builder.parse(is);
    }
}

Related

  1. parse(InputStream byteStream)
  2. parse(InputStream in)
  3. parse(InputStream in)
  4. parse(InputStream inputStream)
  5. parse(InputStream inputStream)
  6. parse(InputStream is)
  7. parse(InputStream is)
  8. parse(InputStream is)
  9. parse(InputStream is)