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 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 "dom2.dtd">
  19. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="documentimportnode20">
  20. <metadata>
  21. <title>documentimportnode20</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         The importNode method imports a node from another document to this document.
  25.         The returned node has no parent; (parentNode is null). The source node is not
  26.         altered or removed from the original document but a new copy of the source node
  27.         is created.
  28.        
  29.         Using the method importNode with deep=true, import a entity node ent4
  30.         from this document to a new document object.  The replacement text of this entity is an element
  31.         node, a cdata node and a pi.  Verify if the nodes have been
  32.         imported correctly by checking the nodeNames of the imported element node, the data for the
  33.         cdata nodes and the PItarget and PIData for the pi nodes.
  34. </description>
  35. <contributor>Neil Delima</contributor>
  36. <date qualifier="created">2002-04-30</date>
  37. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core"/>
  38. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode"/>
  39. </metadata>
  40. <implementationAttribute name="namespaceAware" value="true"/>
  41. <implementationAttribute name="expandEntityReferences" value="false"/>
  42. <var name="doc" type="Document"/>
  43. <var name="docImp" type="Document"/>
  44. <var name="domImpl" type="DOMImplementation"/>
  45. <var name="docType" type="DocumentType"/>
  46. <var name="docTypeNull" type="DocumentType" isNull="true"/>
  47. <var name="nodeMap" type="NamedNodeMap"/>
  48. <var name="entity4" type="Entity"/>
  49. <var name="entityImp4" type="Entity"/>
  50. <var name="element" type="Element"/>
  51. <var name="cdata" type="CharacterData"/>
  52. <var name="pi" type="ProcessingInstruction"/>
  53. <var name="childList" type="NodeList"/>
  54. <var name="elemchildList" type="NodeList"/>
  55. <var name="ent4Name" type="DOMString"/>
  56. <var name="ent4ImpName" type="DOMString"/>
  57. <var name="cdataVal" type="DOMString"/>
  58. <var name="piTargetVal" type="DOMString"/>
  59. <var name="piDataVal" type="DOMString"/>
  60. <load var="doc" href="staffNS" willBeModified="true"/>
  61. <implementation var="domImpl" obj="doc" />
  62. <doctype var="docType" obj="doc"/>
  63. <createDocument var="docImp" obj="domImpl" namespaceURI='"http://www.w3.org/DOM/Test"' qualifiedName='"a:b"' doctype="docTypeNull"/>
  64. <entities var="nodeMap" obj="docType"/>
  65. <getNamedItem var="entity4" obj="nodeMap" name='"ent4"'/>
  66. <importNode  var="entityImp4" obj="docImp" importedNode="entity4" deep="true"/>
  67. <childNodes var="childList" obj="entityImp4" />
  68. <item var="element" obj="childList" index="0" interface="NodeList"/>
  69. <childNodes var="elemchildList" obj="element"/>
  70. <item var="cdata" obj="elemchildList" index="0" interface="NodeList"/>
  71. <item var="pi" obj="childList" index="1" interface="NodeList"/>
  72. <nodeName var="ent4Name" obj="entity4"/>
  73. <nodeName var="ent4ImpName" obj="entityImp4"/>
  74. <data var="cdataVal" obj="cdata" interface="CharacterData"/>
  75. <target var="piTargetVal" obj="pi" interface="ProcessingInstruction"/>
  76. <data var="piDataVal" obj="pi"  interface="ProcessingInstruction"/>
  77. <assertEquals expected="ent4Name" actual="ent4ImpName" id="documentimportnode20_Ent4NodeName" ignoreCase="false"/>
  78. <assertEquals expected='"Element data"' actual="cdataVal" id="documentimportnode20_Cdata"  ignoreCase="false"/>
  79. <assertEquals expected='"PItarget"' actual="piTargetVal" id="documentimportnode20_PITarget"  ignoreCase="false"/>
  80. <assertEquals expected='"PIdata"' actual="piDataVal" id="documentimportnode20_PIData"  ignoreCase="false"/>
  81. </test>