Code example for SAXException

        try { 
            return validateGETMAP(xml, DataUtilities.fileToURL(schemaFile));
        } catch (Exception e) {
            ArrayList al = new ArrayList();
            al.add(new SAXException(e));
            return al;
    public static String getErrorMessage(InputStream xml, List errors) {
        return getErrorMessage(new InputStreamReader(xml), errors);
       *  returns a better formated error message - suitable for framing. 
       * There's a more complex version in StylesEditorAction. 
       * This will kick out a VERY LARGE errorMessage. 
Connect your IDE to all the code out there  Get Codota for Java