Package org.w3c.dom

Examples of org.w3c.dom.Document.lookupNamespaceURI()


        super(dbf);
    }

    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        assertNull(document.lookupNamespaceURI("p"));
    }
}
View Full Code Here


    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        Element documentElement = document.createElementNS("urn:test", "ns:root");
        documentElement.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:ns", "urn:test");
        document.appendChild(documentElement);
        assertEquals("urn:test", document.lookupNamespaceURI("ns"));
        // The following assertion is important to check that there is no infinite recursion
        // (Document delegates the lookup to its document element, but the document element must
        // not delegate to its parent if no matching declaration is found)
        assertNull(document.lookupNamespaceURI("p"));
    }
View Full Code Here

        document.appendChild(documentElement);
        assertEquals("urn:test", document.lookupNamespaceURI("ns"));
        // The following assertion is important to check that there is no infinite recursion
        // (Document delegates the lookup to its document element, but the document element must
        // not delegate to its parent if no matching declaration is found)
        assertNull(document.lookupNamespaceURI("p"));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.