Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.xml.parsers.*;

public class Main {
    private static javax.xml.parsers.DocumentBuilderFactory docFactory;

    public static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException {
        docFactory = DocumentBuilderFactory.newInstance();
        //this line of code not work properly
        //docFactory.setValidating(false);
        //this line of code evite to search the validation parameter just if you want read the xml coe withourt meta information
        docFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
        return docFactory;
    }
}