0
|
1 |
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
|
|
2 |
|
|
3 |
<!--
|
|
4 |
|
|
5 |
Copyright (c) 2001-2004 World Wide Web Consortium,
|
|
6 |
(Massachusetts Institute of Technology, Institut National de
|
|
7 |
Recherche en Informatique et en Automatique, Keio University). All
|
|
8 |
Rights Reserved. This program is distributed under the W3C's Software
|
|
9 |
Intellectual Property License. This program is distributed in the
|
|
10 |
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
11 |
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
12 |
PURPOSE.
|
|
13 |
|
|
14 |
See W3C License http://www.w3.org/Consortium/Legal/ for more details.
|
|
15 |
|
|
16 |
-->
|
|
17 |
|
|
18 |
|
|
19 |
<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="documentrenamenode01">
|
|
20 |
<metadata>
|
|
21 |
<title>documentrenamenode01</title>
|
|
22 |
<creator>IBM</creator>
|
|
23 |
<description>
|
|
24 |
Invoke the renameNode method to rename the class attribute node of the
|
|
25 |
second element whose localName is acronym and namespaceURI http://www.nist.gov
|
|
26 |
with the new namespaceURI as http://www.w3.org/DOM/Test and name as pre0fix:renamedNode.
|
|
27 |
Check if this attribute has been renamed successfully by verifying the
|
|
28 |
nodeName, namespaceURI, nodeType attributes of the renamed node.
|
|
29 |
</description>
|
|
30 |
<contributor>Neil Delima</contributor>
|
|
31 |
<date qualifier="created">2002-06-10</date>
|
|
32 |
<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-renameNode"/>
|
|
33 |
</metadata>
|
|
34 |
<var name="doc" type="Document"/>
|
|
35 |
<var name="element" type="Element"/>
|
|
36 |
<var name="attr" type="Attr"/>
|
|
37 |
<var name="childList" type="NodeList"/>
|
|
38 |
<var name="renamedclass" type="Node"/>
|
|
39 |
<var name="nodeName" type="DOMString"/>
|
|
40 |
<var name="nodeType" type="int"/>
|
|
41 |
<var name="namespaceURI" type="DOMString"/>
|
|
42 |
<load var="doc" href="hc_staff" willBeModified="true"/>
|
|
43 |
<getElementsByTagName var="childList" obj="doc" tagname='"acronym"' interface="Document"/>
|
|
44 |
<item var="element" obj="childList" index="1" interface="NodeList"/>
|
|
45 |
<getAttributeNode var="attr" obj="element" name='"class"'/>
|
|
46 |
<renameNode var="renamedclass" obj="doc" n="attr" namespaceURI='"http://www.w3.org/DOM/Test"' qualifiedName='"renamedNode"'/>
|
|
47 |
<nodeName var="nodeName" obj="renamedclass"/>
|
|
48 |
<namespaceURI var="namespaceURI" obj="renamedclass" interface="Node"/>
|
|
49 |
<nodeType var="nodeType" obj="renamedclass"/>
|
|
50 |
<assertEquals expected='"renamedNode"' actual="nodeName" id="documentrenameode01_nodeName" ignoreCase="false"/>
|
|
51 |
<assertEquals expected="2" actual="nodeType" id="documentrenameNode01_nodeType" ignoreCase="false"/>
|
|
52 |
<assertEquals expected='"http://www.w3.org/DOM/Test"' actual="namespaceURI" id="documentrenamenode01_nodeValue" ignoreCase="false"/>
|
|
53 |
</test>
|