Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.xml.parsers.DocumentBuilderFactory;

public class Main {
    /**
     * Creates and configures a DocumentBuilderFactory for use with DOM. The
     * returned DocumentBuilderFactory is namespace aware and the parsers
     * constructed with it will not eliminate whitespace in elements.
     * 
     * @return Properly configured DocumentBuilderFactory
     */
    static DocumentBuilderFactory createDOMFactory() {
        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        domFactory.setNamespaceAware(true);
        domFactory.setIgnoringElementContentWhitespace(false);
        return domFactory;
    }
}