Java XML Document from Stream load(InputStream stream)

Here you can find the source of load(InputStream stream)

Description

load

License

Open Source License

Declaration

public static Document load(InputStream stream) throws SAXException, IOException, ParserConfigurationException 

Method Source Code

//package com.java2s;
/**//  ww  w  .j a v a 2s .c  o m
 *  Copyright (c) 2013-2014 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */

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 load(InputStream stream) throws SAXException, IOException, ParserConfigurationException {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.parse(stream);
    }
}

Related

  1. getXML(InputStream stream)
  2. getXML(InputStream stream)
  3. load(InputStream data)
  4. load(InputStream inputStream)
  5. loadDocument(InputStream documentInputStream)
  6. loadDocument(InputStream documentInputStream)
  7. loadDocument(InputStream in)
  8. loadDocument(InputStream is)