private static Document loadPrefsDoc(InputStream in) throws SAXException, IOException {
  DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
  dbf.setIgnoringElementContentWhitespace(true);
  dbf.setValidating(true);
  dbf.setCoalescing(true);
  dbf.setIgnoringComments(true);
  try {
    DocumentBuilder db=dbf.newDocumentBuilder();
    db.setEntityResolver(new Resolver());
    db.setErrorHandler(new EH());
    return db.parse(new InputSource(in));
  }
 catch (  ParserConfigurationException e) {
    throw new AssertionError(e);
  }
}

private static Document loadPrefsDoc ( InputStream in ) throws SAXException , IOException { DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setIgnoringElementContentWhitespace ( true ) ; dbf . setValidating ( true ) ; dbf . setCoalescing ( true ) ; dbf . setIgnoringComments ( true ) ; try { DocumentBuilder db = dbf . newDocumentBuilder ( ) ; db . setEntityResolver ( new Resolver ( ) ) ; db . setErrorHandler ( new EH ( ) ) ; return db . parse ( new InputSource ( in ) ) ; } catch ( ParserConfigurationException e ) { throw new AssertionError ( e ) ; } }
load an xml document from specified input stream , which must have the requisite dtd uri .
