Java XML Document from Stream loadDocument(InputStream documentInputStream)

Here you can find the source of loadDocument(InputStream documentInputStream)

Description

load Document

License

Open Source License

Declaration

public static Document loadDocument(InputStream documentInputStream)
            throws ParserConfigurationException, SAXException, IOException 

Method Source Code


//package com.java2s;
/*//from   w  w w .j  ava 2 s.  c  om
 * SafeOnline project.
 *
 * Copyright 2006 Lin.k N.V. All rights reserved.
 * Lin.k N.V. proprietary/confidential. Use is subject to license terms.
 */

import java.io.*;
import javax.xml.parsers.*;

import org.w3c.dom.Document;

import org.xml.sax.SAXException;

public class Main {
    public static Document loadDocument(InputStream documentInputStream)
            throws ParserConfigurationException, SAXException, IOException {

        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);
        DocumentBuilder documentBuilder;
        documentBuilder = documentBuilderFactory.newDocumentBuilder();
        return documentBuilder.parse(documentInputStream);
    }
}

Related

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