Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

import org.w3c.dom.Document;

public class Main {
    /**
     * createXmlDocumnet creates a new Document object using the JAXP API.
     * @return Document a DOM style Document object.
     * @throws ParserConfigurationException
     */
    public static Document createXmlDocument() throws ParserConfigurationException {
        DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = fact.newDocumentBuilder();
        Document doc = db.newDocument();
        return (doc);
    }
}