Code example for SAXException

Methods: getClass, getMessage

0
        List<PeriodicTableElement> elements = new ArrayList<org.openscience.cdk.tools.periodictable.PeriodicTableElement>();
        try { 
            parser.setFeature("http://xml.org/sax/features/validation", false);
            logger.info("Deactivated validation");
        } catch (SAXException exception) {
            logger.warn("Cannot deactivate validation: ", exception.getMessage());
            logger.debug(exception);
        } 
        ElementPTHandler handler = new org.openscience.cdk.tools.periodictable.ElementPTHandler();
        parser.setContentHandler(handler);
        try { 
            parser.parse(new InputSource(input));
            elements = handler.getElements();
        } catch (IOException exception) {
            logger.error("IOException: ", exception.getMessage());
            logger.debug(exception);
        } catch (SAXException saxe) {
            logger.error("SAXException: ", saxe.getClass().getName());
            logger.error(saxe.getMessage());
            logger.debug(saxe);
        } 
        return elements;
    } 
 
}