Code example for SAXException

Methods: getException

0
            final DocumentBuilder builder = factory.newDocumentBuilder();
            document = builder.parse(new ByteArrayInputStream(xml.getBytes()));
        } catch (SAXException sxe) {
            // Error generated during parsing) 
            Exception  x = sxe;
            if (sxe.getException() != null) {
                x = sxe.getException();
            } 
            LOG.appWarning("getXMLDocument: could not parse: " + xml);
            return null; 
        } catch (ParserConfigurationException pce) {
            // Parser with specified options can't be built 
            pce.printStackTrace();
            return null; 
        } catch (IOException ioe) {
            // I/O error 
            ioe.printStackTrace();
            return null; 
        } 
        return document;
Contextual code suggestions in your IDE  Get Codota for Java