3 This Java source file was generated by test-to-java.xsl
4 and is a derived work from the source document.
5 The source document contained the following notice:
9 Copyright (c) 2001 World Wide Web Consortium,
10 (Massachusetts Institute of Technology, Institut National de
11 Recherche en Informatique et en Automatique, Keio University). All
12 Rights Reserved. This program is distributed under the W3C's Software
13 Intellectual Property License. This program is distributed in the
14 hope that it will be useful, but WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18 See W3C License http://www.w3.org/Consortium/Legal/ for more details.
23 package org.w3c.domts.level2.core;
28 import org.w3c.domts.DOMTestCase;
29 import org.w3c.domts.DOMTestDocumentBuilderFactory;
34 * The method removeNamedItemNS removes a node specified by local name and namespace
36 * Retreive an attribute node and then remove from the NamedNodeMap. Verify if the attribute
37 * node was actually remove from the node map.
40 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
42 public final class namednodemapremovenameditemns01 extends DOMTestCase {
46 * @param factory document factory, may not be null
47 * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
49 public namednodemapremovenameditemns01(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException {
51 org.w3c.domts.DocumentBuilderSetting[] settings =
52 new org.w3c.domts.DocumentBuilderSetting[] {
53 org.w3c.domts.DocumentBuilderSetting.namespaceAware
55 DOMTestDocumentBuilderFactory testFactory = factory.newInstance(settings);
56 setFactory(testFactory);
59 // check if loaded documents are supported for content type
61 String contentType = getContentType();
62 preload(contentType, "staffNS", true);
67 * @throws Throwable Any uncaught exception causes test to fail
69 public void runTest() throws Throwable {
71 NamedNodeMap attributes;
75 doc = (Document) load("staffNS", true);
76 elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address");
77 element = elementList.item(1);
78 attributes = element.getAttributes();
79 attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic");
80 attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic");
81 assertNull("namednodemapremovenameditemns01", attribute);
84 * Gets URI that identifies the test.
85 * @return uri identifier of test
87 public String getTargetURI() {
88 return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/namednodemapremovenameditemns01";
91 * Runs this test from the command line.
92 * @param args command line arguments
94 public static void main(final String[] args) {
95 DOMTestCase.doMain(namednodemapremovenameditemns01.class, args);