Android XML Document Create createEmptyDocument()

Here you can find the source of createEmptyDocument()

Description

create Empty Document

Declaration

public static Document createEmptyDocument() 

Method Source Code

//package com.java2s;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;

public class Main {
    public static Document createEmptyDocument() {
        final DocumentBuilderFactory factory = DocumentBuilderFactory
                .newInstance();/*from www .  j a v  a2s.  c  o m*/

        try {
            return factory.newDocumentBuilder().newDocument();
        } catch (ParserConfigurationException e) {
            throw new RuntimeException("Should not reach this point");
        }
    }
}

Related

  1. createNewDocument()
  2. createDocument()
  3. newDocument(String rootName)
  4. stringToDocument(String xmlString)