trunk/resources/tests/dom3/Core/documentadoptnode21.xml
changeset 0 5057afe1ec87
equal deleted inserted replaced
-1:000000000000 0:5057afe1ec87
       
     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="documentadoptnode21">
       
    20 <metadata>
       
    21 <title>documentadoptnode21</title>
       
    22 <creator>IBM</creator>
       
    23 <description>
       
    24 	The adoptNode method changes the ownerDocument of a node, its children, as well as the 
       
    25 	attached attribute nodes if there are any. If the node has a parent it is first removed 
       
    26 	from its parent child list. 
       
    27 	
       
    28 	Invoke the adoptNode method on this Document with the source node being an existing attribute
       
    29         that is a part of this Document.   Verify that the returned adopted node's nodeName, nodeValue
       
    30         and nodeType are as expected and that the ownerElement attribute of the returned attribute node 
       
    31         was set to null.
       
    32 </description>
       
    33 <contributor>Neil Delima</contributor>
       
    34 <date qualifier="created">2002-06-10</date>
       
    35 <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-adoptNode"/>
       
    36 </metadata>
       
    37 <implementationAttribute name="namespaceAware" value="true"/>
       
    38 <var name="doc" type="Document"/>
       
    39 <var name="attrOwnerElem" type="Element"/>
       
    40 <var name="element" type="Element"/>
       
    41 <var name="attr" type="Attr"/>
       
    42 <var name="childList" type="NodeList"/>
       
    43 <var name="adoptedTitle" type="Node"/>
       
    44 <var name="attrsParent" type="Node"/>
       
    45 <var name="nodeName" type="DOMString"/>
       
    46 <var name="nodeType" type="int"/>
       
    47 <var name="nodeValue" type="DOMString"/>
       
    48 <load var="doc" href="hc_staff" willBeModified="false"/>
       
    49 <getElementsByTagName var="childList" obj="doc" tagname='"acronym"' interface="Document"/>
       
    50 <item var="element" obj="childList" index="0" interface="NodeList"/>
       
    51 <getAttributeNode var="attr" obj="element" name='"title"'/>
       
    52 <adoptNode var="adoptedTitle" obj="doc" source="attr"/>
       
    53 <nodeName var="nodeName" obj="adoptedTitle"/>
       
    54 <nodeValue var="nodeValue" obj="adoptedTitle"/>
       
    55 <nodeType var="nodeType" obj="adoptedTitle"/>
       
    56 <ownerElement var="attrOwnerElem" obj="adoptedTitle" interface="Attr"/>
       
    57 <assertEquals expected='"title"' actual="nodeName"  id="documentadoptnode21_nodeName" ignoreCase="false"/>
       
    58 <assertEquals expected="2" actual="nodeType"  id="documentadoptnode21_nodeType" ignoreCase="false"/>
       
    59 <assertEquals expected='"Yes"' actual="nodeValue"  id="documentadoptnode21_nodeValue" ignoreCase="false"/>
       
    60 <assertNull  actual="attrOwnerElem"  id="documentadoptnode21_ownerDoc"/>
       
    61 </test>