Search in sources :

Example 31 with SAXNotSupportedException

use of org.xml.sax.SAXNotSupportedException in project j2objc by google.

the class SAXNotSupportedExceptionTest method testSAXNotSupportedException_String.

public void testSAXNotSupportedException_String() {
    SAXNotSupportedException e = new SAXNotSupportedException(ERR);
    assertEquals(ERR, e.getMessage());
    e = new SAXNotSupportedException(null);
    assertNull(e.getMessage());
}
Also used : SAXNotSupportedException(org.xml.sax.SAXNotSupportedException)

Example 32 with SAXNotSupportedException

use of org.xml.sax.SAXNotSupportedException in project pentaho-kettle by pentaho.

the class XMLInputSaxFieldRetriever method parseDocument.

private void parseDocument() {
    // get a factory
    SAXParserFactory spf = null;
    try {
        spf = XMLParserFactoryProducer.createSecureSAXParserFactory();
    } catch (SAXNotSupportedException | SAXNotRecognizedException | ParserConfigurationException ex) {
        log.logError(ex.getMessage());
    }
    try {
        // get a new instance of parser
        SAXParser sp = spf.newSAXParser();
        // parse the file and also register this class for call backs
        sp.parse(sourceFile, this);
    } catch (SAXException se) {
        log.logError(Const.getStackTracker(se));
    } catch (ParserConfigurationException pce) {
        log.logError(Const.getStackTracker(pce));
    } catch (IOException ie) {
        log.logError(Const.getStackTracker(ie));
    }
}
Also used : SAXNotSupportedException(org.xml.sax.SAXNotSupportedException) SAXParser(javax.xml.parsers.SAXParser) SAXNotRecognizedException(org.xml.sax.SAXNotRecognizedException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) SAXParserFactory(javax.xml.parsers.SAXParserFactory) SAXException(org.xml.sax.SAXException)

Example 33 with SAXNotSupportedException

use of org.xml.sax.SAXNotSupportedException in project pentaho-kettle by pentaho.

the class XMLInputSaxDataRetriever method parseDocument.

private void parseDocument() {
    // get a factory
    SAXParserFactory spf = null;
    try {
        spf = XMLParserFactoryProducer.createSecureSAXParserFactory();
    } catch (SAXNotSupportedException | SAXNotRecognizedException | ParserConfigurationException ex) {
        log.logError(ex.getMessage());
    }
    try {
        // get a new instance of parser
        SAXParser sp = spf.newSAXParser();
        // parse the file and also register this class for call backs
        sp.parse(sourceFile, this);
    } catch (SAXException se) {
        log.logError(Const.getStackTracker(se));
    } catch (ParserConfigurationException pce) {
        log.logError(Const.getStackTracker(pce));
    } catch (IOException ie) {
        log.logError(Const.getStackTracker(ie));
    }
}
Also used : SAXNotSupportedException(org.xml.sax.SAXNotSupportedException) SAXParser(javax.xml.parsers.SAXParser) SAXNotRecognizedException(org.xml.sax.SAXNotRecognizedException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) SAXParserFactory(javax.xml.parsers.SAXParserFactory) SAXException(org.xml.sax.SAXException)

Aggregations

SAXNotSupportedException (org.xml.sax.SAXNotSupportedException)33 SAXNotRecognizedException (org.xml.sax.SAXNotRecognizedException)25 XMLReader (org.xml.sax.XMLReader)16 SAXException (org.xml.sax.SAXException)13 SAXParser (javax.xml.parsers.SAXParser)9 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)8 SAXParserFactory (javax.xml.parsers.SAXParserFactory)8 InputSource (org.xml.sax.InputSource)7 IOException (java.io.IOException)6 InputStream (java.io.InputStream)5 SAXSource (javax.xml.transform.sax.SAXSource)4 BufferedInputStream (java.io.BufferedInputStream)3 Reader (java.io.Reader)2 JAXBContext (javax.xml.bind.JAXBContext)2 JAXBElement (javax.xml.bind.JAXBElement)2 JAXBException (javax.xml.bind.JAXBException)2 Unmarshaller (javax.xml.bind.Unmarshaller)2 Source (javax.xml.transform.Source)2 Transformer (javax.xml.transform.Transformer)2 DOMSource (javax.xml.transform.dom.DOMSource)2