elementgetattributenodens02public final class elementgetattributenodens02 extends org.w3c.domts.DOMTestCase The method getAttributeNodeNS retrieves an Attr node by local name and namespace URI.
Create a new element node and add a new attribute node to it. Using the getAttributeNodeNS,
retrieve the newly added attribute node and check its value. |
Constructors Summary |
---|
public elementgetattributenodens02(org.w3c.domts.DOMTestDocumentBuilderFactory factory)Constructor.
org.w3c.domts.DocumentBuilderSetting[] settings =
new org.w3c.domts.DocumentBuilderSetting[] {
org.w3c.domts.DocumentBuilderSetting.namespaceAware
};
DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
setFactory(testFactory);
//
// check if loaded documents are supported for content type
//
String contentType = getContentType();
preload(contentType, "staffNS", false);
|
Methods Summary |
---|
public java.lang.String | getTargetURI()Gets URI that identifies the test.
return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/elementgetattributenodens02";
| public static void | main(java.lang.String[] args)Runs this test from the command line.
DOMTestCase.doMain(elementgetattributenodens02.class, args);
| public void | runTest()Runs the test case.
Document doc;
Element element;
Attr attribute;
Attr newAttribute1;
String attrValue;
doc = (Document) load("staffNS", false);
element = doc.createElementNS("namespaceURI", "root");
attribute = doc.createAttributeNS("http://www.w3.org/DOM/Level2", "l2:att");
newAttribute1 = element.setAttributeNodeNS(attribute);
attribute = element.getAttributeNodeNS("http://www.w3.org/DOM/Level2", "att");
attrValue = attribute.getNodeValue();
assertEquals("elementgetattributenodens02", "", attrValue);
|
|