Here you can find the source of createEmptyDocument()
Parameter | Description |
---|---|
ParserConfigurationException | an exception |
public static Document createEmptyDocument() throws ParserConfigurationException
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Document; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { /**/* w w w .j a va 2 s. c o m*/ * Create empty document * * @return * @throws ParserConfigurationException */ public static Document createEmptyDocument() throws ParserConfigurationException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = dbf.newDocumentBuilder(); return builder.newDocument(); } }