Code example for SAXParseException

0
                throw new SAXParseException(
                        "InputSource needs a stream, reader or URI", null); 
            } 
 
            if(parser.nextToken() == XmlPullParser.END_DOCUMENT) {
                throw new SAXParseException(
                        "Unexpected end of document", null); 
            } 
 
            parse(parser, document, document, XmlPullParser.END_DOCUMENT);
 
            parser.require(XmlPullParser.END_DOCUMENT, null, null);
        } catch (XmlPullParserException ex) {
            if(ex.getDetail() instanceof IOException) {
                throw (IOException)ex.getDetail();
            } 
            if(ex.getDetail() instanceof RuntimeException) {
                throw (RuntimeException)ex.getDetail();
            } 
 
            LocatorImpl locator = new LocatorImpl();