Java XML SAX Parser getSAXParser()

Here you can find the source of getSAXParser()

Description

Creates a new SAXParser.

License

Open Source License

Exception

Parameter Description
ParserConfigurationException If there are any error with the SAX parser creation
SAXException If there are any error with the SAX parser creation

Return

A new SAXParser

Declaration

public static SAXParser getSAXParser() throws ParserConfigurationException, SAXException 

Method Source Code

//package com.java2s;
/*//from  w ww.  j  a va  2s. c o  m
 * Copyright Paolo Dragone 2014.
 * Copyright Alessandro Ronca 2014.
 *
 * This file is part of Wiktionary Ontology.
 *
 * Wiktionary Ontology is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Wiktionary Ontology is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Wiktionary Ontology. If not, see <http://www.gnu.org/licenses/>.
 */

import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

public class Main {
    /**
     * Creates a new SAXParser.
     *
     * @return A new SAXParser
     * @throws ParserConfigurationException If there are any error with the SAX parser creation
     * @throws SAXException                 If there are any error with the SAX parser creation
     */
    public static SAXParser getSAXParser() throws ParserConfigurationException, SAXException {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        return factory.newSAXParser();
    }
}

Related

  1. createXmlReader()
  2. extractClasses(String xmlContent)
  3. getFactory()
  4. getSAXParser()
  5. getSAXParser()
  6. getSAXParserFactory()
  7. getSAXSDDriver()
  8. getSchema(File xsd, ErrorHandler errorHandler)
  9. getSchema(URL xml_schema)