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 org.w3c.dom.*;

public class Main {
    static DocumentBuilderFactory dbFactory = null;
    static DocumentBuilderFactory dbFactoryForNameSpaceBuilders;

    public static Document newDocumentNS() throws Exception {
        DocumentBuilder parser = dbFactoryForNameSpaceBuilders.newDocumentBuilder();
        return parser.newDocument();
    }

    public static Document newDocument() throws Exception {
        DocumentBuilder parser = dbFactory.newDocumentBuilder();
        return parser.newDocument();
    }
}