Code example for DocumentBuilder

Methods: parse

0
    } 
 
    public void testParserBadXML() { 
        System.out.println("-- testParserBadXML");
        try { 
            builder.parse(getAsStream(BAD_XML));
            assertTrue(true); 
        } catch (SAXException x) {
            fail("MUST be able to parse a good restlet.xml with xmlns attribute"); 
        } catch (IOException x) {
            fail("MUST be able to parse a good restlet.xml with xmlns attribute"); 
        } 
    } 
 
    public void testParserWithoutXMLNS() { 
        System.out.println("-- testParserWithoutXMLNS");
        try { 
            builder.parse(getAsStream(XML_WITHOUT_XMLNS));
            assertTrue(true); 
        } catch (SAXException x) {
Connect your IDE to all the code out there  Get Codota for Java