Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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. <!DOCTYPE test SYSTEM "dom3.dtd">
  19. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="documentadoptnode24">
  20. <metadata>
  21. <title>documentadoptnode24</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.         For Element Nodes, specified attribute nodes of the source element are adopted, Default
  28.         attributes are discarded and descendants of the source element are recursively adopted.
  29.  
  30.         Invoke the adoptNode method on a new document with the first code element node of this
  31.         Document as the source.  Verify if the node has been adopted correctly by checking the
  32.         length of the this elements childNode list before and after.
  33. </description>
  34. <contributor>Neil Delima</contributor>
  35. <date qualifier="created">2002-06-10</date>
  36. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-adoptNode"/>
  37. </metadata>
  38. <implementationAttribute name="namespaceAware" value="true"/>
  39. <var name="doc" type="Document"/>
  40. <var name="newDoc" type="Document"/>
  41. <var name="domImpl" type="DOMImplementation"/>
  42. <var name="childList" type="NodeList"/>
  43. <var name="adoptedNode" type="Node"/>
  44. <var name="codeElem" type="Element"/>
  45. <var name="codeElemChildren" type="NodeList"/>
  46. <var name="adoptedChildren" type="NodeList"/>
  47. <var name="codeElemLen" type="int"/>
  48. <var name="adoptedLen" type="int"/>
  49. <var name="nullDocType" type="DocumentType" isNull="true"/>
  50. <load var="doc" href="hc_staff" willBeModified="false"/>
  51. <implementation var="domImpl" obj="doc"/>
  52. <createDocument var="newDoc" obj="domImpl" namespaceURI='"http://www.w3.org/DOM/Test"' qualifiedName='"dom:test"' doctype="nullDocType"/>
  53. <getElementsByTagNameNS var="childList" obj="doc" namespaceURI='"*"' localName='"code"' interface="Document"/>
  54. <item var="codeElem" obj="childList" index="0" interface="NodeList"/>
  55. <adoptNode var="adoptedNode" obj="newDoc" source="codeElem"/>
  56. <childNodes var="codeElemChildren"  obj="codeElem"/>
  57. <childNodes var="adoptedChildren"  obj="adoptedNode"/>
  58. <length var="codeElemLen" obj="codeElemChildren" interface="NodeList"/>
  59. <length var="adoptedLen" obj="adoptedChildren" interface="NodeList"/>
  60. <assertEquals actual="codeElemLen" expected="adoptedLen" id="documentadoptnode24" ignoreCase="false"/>
  61. </test>
  62.