Code example for SAXParseException

Methods: printStackTracegetMessagegetColumnNumbergetLineNumber

0
        InputSource is = new InputSource("file:/home/zaurus/Documents/sample.xml");
        try { 
            parser.parse(is, handler);
        } 
        catch (SAXParseException se) {
            se.printStackTrace();
            System.out.println(se.getMessage());
            System.out.println(se.getLineNumber());
            System.out.println(se.getColumnNumber());
        } 
    } 
 
    private static class SimpleHandler extends DefaultHandler {
        private Writer out;
        private String indentString = " "; // Amount to indent
        private int indentLevel = 0;
        private StringBuffer textBuffer;
 
        SimpleHandler(Writer out) {
            this.out = out;
Connect your IDE to all the code out there  Get Codota for Java