public boolean read ( File inputFile ) throws SAXException , IOException { boolean success = false ; try ( FileInputStream fs = new FileInputStream ( inputFile ) ) { XMLReader parser = XMLReaderFactory . createXMLReader ( ) ; parser . setErrorHandler ( this ) ; parser . setContentHandler ( this ) ; parser . parse ( new InputSource ( fs ) ) ; success = true ; } return success ; }
Reads the document and pre - parses it . The other method is called automatically when a start markup is found .