|
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="documentadoptnode06"> |
|
20 <metadata> |
|
21 <title>documentadoptnode06</title> |
|
22 <creator>IBM</creator> |
|
23 <description> |
|
24 Invoke adoptNode on a new document to adopt the a new Attribute node having a Text and an EntityReference |
|
25 child. Check if this attribute has been adopted successfully by verifying the nodeName, namespaceURI, prefix, |
|
26 specified and ownerElement attributes of the adopted node. Also verify the ownerDocument attribute |
|
27 of the adopted node and the adopted children of the attribute node. |
|
28 </description> |
|
29 <contributor>Neil Delima</contributor> |
|
30 <date qualifier="created">2002-06-10</date> |
|
31 <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-adoptNode"/> |
|
32 </metadata> |
|
33 <var name="doc" type="Document"/> |
|
34 <var name="newDoc" type="Document"/> |
|
35 <var name="domImpl" type="DOMImplementation"/> |
|
36 <var name="newAttr" type="Attr"/> |
|
37 <var name="newText" type="Text"/> |
|
38 <var name="newEntRef" type="EntityReference"/> |
|
39 <var name="adoptedAttr" type="Attr"/> |
|
40 <var name="adoptText" type="Text"/> |
|
41 <var name="adoptEntRef" type="EntityReference"/> |
|
42 <var name="nodeList" type="NodeList"/> |
|
43 <var name="nodeName" type="DOMString"/> |
|
44 <var name="nodeNamespaceURI" type="DOMString"/> |
|
45 <var name="nodePrefix" type="DOMString"/> |
|
46 <var name="attrOwnerElem" type="Element"/> |
|
47 <var name="isSpecified" type="boolean"/> |
|
48 <var name="adoptedTextNodeValue" type="DOMString"/> |
|
49 <var name="adoptedEntRefNodeValue" type="DOMString"/> |
|
50 <var name="nullDocType" type="DocumentType" isNull="true"/> |
|
51 <var name="appendedChild" type="Node"/> |
|
52 <var name="docElem" type="Element"/> |
|
53 <var name="rootNS" type="DOMString"/> |
|
54 <var name="rootName" type="DOMString"/> |
|
55 <var name="xmlNS" type="DOMString" value='"http://www.w3.org/XML/1998/namespace"'/> |
|
56 <load var="doc" href="hc_staff" willBeModified="true"/> |
|
57 <documentElement var="docElem" obj="doc"/> |
|
58 <tagName var="rootName" obj="docElem"/> |
|
59 <namespaceURI var="rootNS" obj="docElem" interface="Node"/> |
|
60 <implementation var="domImpl" obj="doc"/> |
|
61 <createDocument var="newDoc" obj="domImpl" namespaceURI="rootNS" qualifiedName="rootName" doctype="nullDocType"/> |
|
62 <createAttributeNS var="newAttr" obj="doc" namespaceURI="xmlNS" qualifiedName='"xml:lang"'/> |
|
63 <createTextNode var="newText" obj="doc" data='"Text Node"'/> |
|
64 <createEntityReference var="newEntRef" obj="doc" name='"alpha"'/> |
|
65 <appendChild obj="newAttr" var="appendedChild" newChild="newText"/> |
|
66 <appendChild obj="newAttr" var="appendedChild" newChild="newEntRef"/> |
|
67 <adoptNode var="adoptedAttr" obj="newDoc" source="newAttr"/> |
|
68 <if><notNull obj="adoptedAttr"/> |
|
69 <nodeName var="nodeName" obj="adoptedAttr"/> |
|
70 <namespaceURI var="nodeNamespaceURI" obj="adoptedAttr" interface="Node"/> |
|
71 <prefix var="nodePrefix" obj="adoptedAttr"/> |
|
72 <ownerElement var="attrOwnerElem" obj="adoptedAttr" interface="Attr"/> |
|
73 <specified var="isSpecified" obj="adoptedAttr" /> |
|
74 <assertEquals expected='"xml:lang"' actual="nodeName" id="documentadoptnode06_nodeName" ignoreCase="false"/> |
|
75 <assertEquals expected="xmlNS" actual="nodeNamespaceURI" id="documentadoptnode06_namespaceURI" ignoreCase="false"/> |
|
76 <assertEquals expected='"xml"' actual="nodePrefix" id="documentadoptnode06_prefix" ignoreCase="false"/> |
|
77 <assertNull actual="attrOwnerElem" id="documentadoptnode06_ownerDoc"/> |
|
78 <assertTrue actual="isSpecified" id="documentadoptnode06_specified"/> |
|
79 <childNodes var="nodeList" obj="adoptedAttr"/> |
|
80 <item var="adoptText" obj="nodeList" index="0" interface="NodeList"/> |
|
81 <item var="adoptEntRef" obj="nodeList" index="1" interface="NodeList"/> |
|
82 <nodeValue var="adoptedTextNodeValue" obj="adoptText"/> |
|
83 <nodeName var="adoptedEntRefNodeValue" obj="adoptEntRef"/> |
|
84 <assertEquals expected='"Text Node"' actual="adoptedTextNodeValue" id="documentadoptnode06_TextNodeValue" ignoreCase="false"/> |
|
85 <assertEquals expected='"alpha"' actual="adoptedEntRefNodeValue" id="documentadoptnode06_EntRefNodeValue" ignoreCase="false"/> |
|
86 </if> |
|
87 </test> |