Code example for Node

Methods: getChildNodes, getFirstChild, getNodeValue

0
        String value;
        doc = (Document) load("staffNS", builder);
        aNewDoc = (Document) load("staffNS", builder);
        comment = aNewDoc.createComment("this is a comment");
        aNode = doc.importNode(comment, false);
        ownerDocument = aNode.getOwnerDocument();
        assertNotNull("ownerDocumentNotNull", ownerDocument);
        docType = ownerDocument.getDoctype();
        system = docType.getSystemId();
        assertURIEquals("systemId", null, null, null, "staffNS.dtd", null, 
                null, null, null, system);
        value = aNode.getNodeValue();
        assertEquals("nodeValue", "this is a comment", value);
    } 
    @TestTargetNew( 
        level = TestLevel.PARTIAL_COMPLETE, 
        notes = "Doesn't verify DOMException.", 
        method = "importNode", 
        args = {org.w3c.dom.Node.class, boolean.class}
    ) 
    public void testImportNode4() throws Throwable {