Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.xml.parsers.SAXParserFactory;

public class Main {
    /**
     * To get a SAXParserFactory instance which is then used to obtain an {@link SAXParser} instance.
     * 
     * @param namespaces Whether to provide namespace support.
     * @param validation Whether to produce a validating SAX parser.
     * @return the SAXParserFactory for further use
     */
    public static SAXParserFactory getSAXParserFactory(final boolean validation, final boolean namespaces) {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(namespaces);
        factory.setValidating(validation);
        return factory;
    }
}