Java XML Document Create newDocument()

Here you can find the source of newDocument()

Description

new document

License

LGPL

Declaration

public static Document newDocument() 

Method Source Code

//package com.java2s;
/*// ww  w .  ja  v  a 2 s.c o m
 * JFox - The most lightweight Java EE Application Server!
 * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
 *
 * JFox is licenced and re-distributable under GNU LGPL.
 */

import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;

public class Main {
    private final static DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

    /**
     * new document
     */
    public static Document newDocument() {
        try {
            return dbf.newDocumentBuilder().newDocument();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

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