Code example for DocumentBuilder

Methods: parse, setEntityResolver

0
        //dbf.setCoalescing(true); 
        //dbf.setExpandEntityReferences(true); 
 
        DocumentBuilder db = null;
        db = dbf.newDocumentBuilder();
        db.setEntityResolver( new NullResolver() );
         
        // db.setErrorHandler( new MyErrorHandler()); 
 
        Document doc = db.parse(xmlF);
        return doc;
    } 
 
}