Code example for DocumentBuilder

Methods: parse, setErrorHandler

0
        //Schema Language Property should be ignored since validation is set to false. 
        dbf.setAttribute(
        "http://java.sun.com/xml/jaxp/properties/schemaLanguage", 
        "http://www.w3.org/2001/XMLSchema"); 
        DocumentBuilder docBuilder = dbf.newDocumentBuilder();
        docBuilder.setErrorHandler(this);
        Document document = docBuilder.parse(
        new File("tests/jaxp/data/personal-schema.xml"));
        System.out.println(" JAXPSpecTest.testSchemaLanguageDOM Passed");
         
    } 
     
    /** DOMParser should throw IllegalArgumentException when SchemaSource property is 
     * set without setting SchemaLanguage property. 
     * @throws Exception 
     */ 
     
    public void testSchemaSourceDOM() throws Exception { 
        try{ 
            System.out.println(" Running JAXPSpecTest.testSchemaSourceDOM ");
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();