Code example for DocumentBuilderFactory

Methods: newDocumentBuilder, setNamespaceAware, setValidating

0
 
    private static DocumentBuilder newDOMer(boolean nsAware, boolean validate)
                throws SAXException, ParserConfigurationException    { 
        DocumentBuilderFactory f= getDFac();
        try        { 
            f.setNamespaceAware(nsAware);
            f.setValidating(validate);
            return f.newDocumentBuilder();
        } 
        catch (ParserConfigurationException e) {
            throw new SAXException(e);
        } 
    } 
 
    private static DocumentBuilderFactory getDFac() {        return _dfac;    }
 
    private static SAXParserFactory getSFac() {        return _sfac;    }
 
    private static Map<String,String> attrsToMap(Attributes atts, boolean fullyQ)    {
        Map<String, String> ret = TM();
        int len = atts==null ? 0 : atts.getLength();