Java XML Document Create createDocument(InputSource is)

Here you can find the source of createDocument(InputSource is)

Description

create Document

License

Open Source License

Declaration

public static Document createDocument(InputSource is) throws Exception 

Method Source Code


//package com.java2s;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.*;
import org.xml.sax.InputSource;

public class Main {
    public static Document createDocument(InputSource is) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        factory.setIgnoringElementContentWhitespace(true);
        factory.setCoalescing(true);/*from   ww  w .java 2s  . c om*/
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.parse(is);
    }
}

Related

  1. createDocument(byte[] data)
  2. createDocument(File file)
  3. createDocument(File file)
  4. createDocument(final File file)
  5. createDocument(final String rootName)
  6. createDocument(Node node)
  7. createDocument(Node sourceNode)
  8. CreateDocument(Path xml, Path xsd)
  9. createDocument(String content, String charset)