Here you can find the source of createDocument()
Parameter | Description |
---|---|
ParserConfigurationException | in case of error |
public static Document createDocument() throws ParserConfigurationException
//package com.java2s; //License from project: Open Source License import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; public class Main { /**//from w ww.ja v a2 s . com * create new DOM document * @return empty DOM object * @throws ParserConfigurationException in case of error */ public static Document createDocument() throws ParserConfigurationException { return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); } }