Example usage for org.apache.commons.digester.parser GenericParser newSAXParser

List of usage examples for org.apache.commons.digester.parser GenericParser newSAXParser

Introduction

In this page you can find the example usage for org.apache.commons.digester.parser GenericParser newSAXParser.

Prototype

public static SAXParser newSAXParser(Properties properties)
        throws ParserConfigurationException, SAXException, SAXNotRecognizedException 

Source Link

Document

Create a SAXParser configured to support XML Scheman and DTD

Usage

From source file:org.codehaus.enunciate.config.EnunciateConfiguration.java

/**
 * Create the digester.//  w  ww  .  j  a  v a  2  s.c  o m
 *
 * @return The digester that was created.
 */
protected Digester createDigester() throws SAXException {
    try {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(false);
        factory.setValidating(false);

        Properties properties = new Properties();
        properties.put("SAXParserFactory", factory);
        //      properties.put("schemaLocation", EnunciateConfiguration.class.getResource("enunciate.xsd").toString());
        //      properties.put("schemaLanguage", "http://www.w3.org/2001/XMLSchema");

        SAXParser parser = GenericParser.newSAXParser(properties);
        return new Digester(parser);
    } catch (ParserConfigurationException e) {
        throw new SAXException(e);
    }
}