blob: 2164ae0683b92dce2456dfeef49de1d5b72c4fb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="test-to-html.xsl" type="text/xml"?>
<!--
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
See W3C License http://www.w3.org/Consortium/Legal/ for more details.
-->
<!DOCTYPE test SYSTEM "dom2.dtd">
<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="documentimportnode22">
<metadata>
<title>documentimportnode21</title>
<creator>IBM</creator>
<description>
The importNode method imports a node from another document to this document.
The returned node has no parent; (parentNode is null). The source node is not
altered or removed from the original document but a new copy of the source node
is created.
Using the method importNode with deep=true/false, import two notaiton nodes into the
same and different documnet objects. In each case check if valid public and systemids
are returned if any and if none, check if a null value was returned.
</description>
<contributor>Neil Delima</contributor>
<date qualifier="created">2002-04-30</date>
<subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core"/>
<subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode"/>
</metadata>
<implementationAttribute name="namespaceAware" value="true"/>
<var name="doc" type="Document"/>
<var name="docTypeNull" type="DocumentType" isNull="true"/>
<var name="docImp" type="Document"/>
<var name="domImpl" type="DOMImplementation"/>
<var name="docType" type="DocumentType"/>
<var name="nodeMap" type="NamedNodeMap"/>
<var name="notation1" type="Notation"/>
<var name="notation2" type="Notation"/>
<var name="notationImp1" type="Notation"/>
<var name="notationImp2" type="Notation"/>
<var name="notationImpNew1" type="Notation"/>
<var name="notationImpNew2" type="Notation"/>
<var name="publicId1" type="DOMString"/>
<var name="publicId1Imp" type="DOMString"/>
<var name="publicId1NewImp" type="DOMString"/>
<var name="publicId2Imp" type="DOMString"/>
<var name="publicId2NewImp" type="DOMString"/>
<var name="systemId1Imp" type="DOMString"/>
<var name="systemId1NewImp" type="DOMString"/>
<var name="systemId2" type="DOMString"/>
<var name="systemId2Imp" type="DOMString"/>
<var name="systemId2NewImp" type="DOMString"/>
<load var="doc" href="staffNS" willBeModified="true"/>
<implementation var="domImpl" obj="doc" />
<doctype var="docType" obj="doc"/>
<createDocument var="docImp" obj="domImpl" namespaceURI='"http://www.w3.org/DOM/Test"' qualifiedName='"a:b"' doctype="docTypeNull"/>
<notations var="nodeMap" obj="docType"/>
<assertNotNull actual="nodeMap" id="notationsNotNull"/>
<getNamedItem var="notation1" obj="nodeMap" name='"notation1"'/>
<getNamedItem var="notation2" obj="nodeMap" name='"notation2"'/>
<importNode var="notationImp1" obj="doc" importedNode="notation1" deep="true"/>
<importNode var="notationImp2" obj="doc" importedNode="notation2" deep="false"/>
<importNode var="notationImpNew1" obj="docImp" importedNode="notation1" deep="false"/>
<importNode var="notationImpNew2" obj="docImp" importedNode="notation2" deep="true"/>
<publicId var="publicId1" obj="notation1" interface="Notation"/>
<publicId var="publicId1Imp" obj="notation1" interface="Notation"/>
<publicId var="publicId1NewImp" obj="notation1" interface="Notation"/>
<systemId var="systemId1Imp" obj="notation1" interface="Notation"/>
<systemId var="systemId1NewImp" obj="notation1" interface="Notation"/>
<publicId var="publicId2Imp" obj="notation2" interface="Notation"/>
<publicId var="publicId2NewImp" obj="notation2" interface="Notation"/>
<systemId var="systemId2" obj="notation2" interface="Notation"/>
<systemId var="systemId2Imp" obj="notation2" interface="Notation"/>
<systemId var="systemId2NewImp" obj="notation2" interface="Notation"/>
<assertEquals expected="publicId1" actual="publicId1Imp" id="documentimportnode22_N1PID" ignoreCase="false"/>
<assertEquals expected="publicId1" actual="publicId1NewImp" id="documentimportnode22_N1NPID" ignoreCase="false"/>
<assertNull actual="systemId1Imp" id="documentimportnode22_N1SID"/>
<assertNull actual="systemId1NewImp" id="documentimportnode22_N1NSID" />
<assertEquals expected="systemId2" actual="systemId2Imp" id="documentimportnode22_N2SID" ignoreCase="false"/>
<assertEquals expected="systemId2" actual="systemId2NewImp" id="documentimportnode22_N2NSID" ignoreCase="false"/>
<assertNull actual="publicId2Imp" id="documentimportnode22_N2PID"/>
<assertNull actual="publicId2Imp" id="documentimportnode22_N2NPID"/>
</test>
|