public InvCatalogImpl readXML ( StringReader catAsStringReader , URI baseUri ) { XMLEntityResolver resolver = new XMLEntityResolver ( false ) ; SAXBuilder builder = resolver . getSAXBuilder ( ) ; Document inDoc ; try { inDoc = builder . build ( catAsStringReader ) ; } catch ( Exception e ) { InvCatalogImpl cat = new InvCatalogImpl ( baseUri . toString ( ) , null , null ) ; cat . appendErrorMessage ( "**Fatal: InvCatalogFactory.readXML(String catAsString, URI url) failed:" + "\n Exception= " + e . getClass ( ) . getName ( ) + " " + e . getMessage ( ) + "\n fatalMessages= " + fatalMessages . toString ( ) + "\n errMessages= " + errMessages . toString ( ) + "\n warnMessages= " + warnMessages . toString ( ) + "\n" , true ) ; return cat ; } return readXML ( inDoc , baseUri ) ; }
Create an InvCatalog by reading catalog XML from a StringReader .