<?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>