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="documentadoptnode01">
|
|
20 |
<metadata>
|
|
21 |
<title>documentadoptnode01</title>
|
|
22 |
<creator>IBM</creator>
|
|
23 |
<description>
|
|
24 |
Adopt the class attribute node of the fourth acronym element. Check if this attribute has been adopted successfully by verifying the
|
|
25 |
nodeName, nodeType, nodeValue, specified and ownerElement attributes of the adopted node.
|
|
26 |
</description>
|
|
27 |
<contributor>Neil Delima</contributor>
|
|
28 |
<date qualifier="created">2002-06-10</date>
|
|
29 |
<subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-adoptNode"/>
|
|
30 |
</metadata>
|
|
31 |
<var name="doc" type="Document"/>
|
|
32 |
<var name="attrOwnerElem" type="Element"/>
|
|
33 |
<var name="element" type="Element"/>
|
|
34 |
<var name="attr" type="Attr"/>
|
|
35 |
<var name="childList" type="NodeList"/>
|
|
36 |
<var name="adoptedclass" type="Node"/>
|
|
37 |
<var name="attrsParent" type="Node"/>
|
|
38 |
<var name="nodeName" type="DOMString"/>
|
|
39 |
<var name="nodeType" type="int"/>
|
|
40 |
<var name="nodeValue" type="DOMString"/>
|
|
41 |
<var name="firstChild" type="Text"/>
|
|
42 |
<var name="firstChildValue" type="DOMString"/>
|
|
43 |
<var name="secondChild" type="EntityReference"/>
|
|
44 |
<var name="secondChildType" type="int"/>
|
|
45 |
<var name="secondChildName" type="DOMString"/>
|
|
46 |
|
|
47 |
|
|
48 |
<load var="doc" href="hc_staff" willBeModified="true"/>
|
|
49 |
<getElementsByTagName var="childList" obj="doc" tagname='"acronym"' interface="Document"/>
|
|
50 |
<item var="element" obj="childList" index="3" interface="NodeList"/>
|
|
51 |
<getAttributeNode var="attr" obj="element" name='"class"'/>
|
|
52 |
<adoptNode var="adoptedclass" obj="doc" source="attr"/>
|
|
53 |
<if><notNull obj="adoptedclass"/>
|
|
54 |
<nodeName var="nodeName" obj="adoptedclass"/>
|
|
55 |
<nodeValue var="nodeValue" obj="adoptedclass"/>
|
|
56 |
<nodeType var="nodeType" obj="adoptedclass"/>
|
|
57 |
<ownerElement var="attrOwnerElem" obj="adoptedclass" interface="Attr"/>
|
|
58 |
<assertEquals expected='"class"' actual="nodeName" id="documentadoptode01_nodeName" ignoreCase="false"/>
|
|
59 |
<assertEquals expected="2" actual="nodeType" id="documentadoptNode01_nodeType" ignoreCase="false"/>
|
|
60 |
<assertNull actual="attrOwnerElem" id="documentadoptnode01_ownerDoc"/>
|
|
61 |
<!-- The attribute's child list can either be a text node "Yα" or
|
|
62 |
an text node "Y" and a entity reference to "alpha" -->
|
|
63 |
<firstChild var="firstChild" obj="adoptedclass" interface="Node"/>
|
|
64 |
<assertNotNull actual="firstChild" id="firstChildNotNull"/>
|
|
65 |
<nodeValue var="firstChildValue" obj="firstChild"/>
|
|
66 |
<if>
|
|
67 |
<equals actual="firstChildValue" expected='"Y"' ignoreCase="false"/>
|
|
68 |
<nextSibling var="secondChild" obj="firstChild" interface="Node"/>
|
|
69 |
<assertNotNull actual="secondChild" id="secondChildNotNull"/>
|
|
70 |
<nodeType var="secondChildType" obj="secondChild"/>
|
|
71 |
<assertEquals actual="secondChildType" expected="5"
|
|
72 |
id="secondChildIsEntityReference" ignoreCase="false"/>
|
|
73 |
<nodeName var="secondChildName" obj="secondChild"/>
|
|
74 |
<assertEquals actual="secondChildName" expected='"alpha"'
|
|
75 |
id="secondChildIsEnt1Reference" ignoreCase="false"/>
|
|
76 |
<else>
|
|
77 |
<assertEquals expected='"Yα"' actual="nodeValue" id="documentadoptnode01_nodeValue" ignoreCase="false"/>
|
|
78 |
</else>
|
|
79 |
</if>
|
|
80 |
</if>
|
|
81 |
</test>
|