Java XML Document Create createDocument(boolean validating, boolean namespaceAware)

Here you can find the source of createDocument(boolean validating, boolean namespaceAware)

Description

create Document

License

Open Source License

Declaration

public static org.w3c.dom.Document createDocument(boolean validating, boolean namespaceAware) throws Exception 

Method Source Code


//package com.java2s;
/*//from   w w  w  .  j  av  a2  s.  c om
 * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
 * This software is open source.
 * See the bottom of this file for the licence.
 */

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

public class Main {
    public static org.w3c.dom.Document createDocument(boolean validating, boolean namespaceAware) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setValidating(validating);
        factory.setNamespaceAware(namespaceAware);

        DocumentBuilder builder = factory.newDocumentBuilder();

        return builder.newDocument();
    }
}

Related

  1. createDocument()
  2. createDocument()
  3. createDocument()
  4. createDocument(boolean createRoot)
  5. createDocument(boolean isSecureProcessing)
  6. createDocument(byte[] data)
  7. createDocument(File file)
  8. createDocument(File file)
  9. createDocument(final File file)