Java XML Document Create newDocument()

Here you can find the source of newDocument()

Description

Creates a new empty DOM document.

License

Open Source License

Exception

Parameter Description
ParserConfigurationException an exception

Return

New empty DOM document.

Declaration


public static Document newDocument() throws ParserConfigurationException 

Method Source Code

//package com.java2s;
/*   Please see the license information at the end of this file. */

import javax.xml.parsers.*;

import org.w3c.dom.*;

public class Main {
    /**   Creates a new empty DOM document.
     *//from   w  ww .  ja  v  a  2s .c  o m
     *   @return      New empty DOM document.
     *
     *   @throws   ParserConfigurationException
     */

    public static Document newDocument() throws ParserConfigurationException {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.newDocument();
    }
}

Related

  1. newDocument()
  2. newDocument()
  3. newDocument()
  4. newDocument()
  5. newDocument()
  6. newDocument()
  7. newDocument()
  8. newDocument()
  9. newDocument()