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="nodereplacechild30">
  20. <metadata>
  21. <title>nodereplacechild30</title>
  22. <creator>IBM</creator>
  23. <description>
  24.  
  25.  
  26.  
  27.         Using replaceChild on an Element node attempt to replace a new Element child node with
  28.         new child nodes and vice versa and in each case verify the name of the replaced node.
  29. </description>
  30. <contributor>Neil Delima</contributor>
  31. <date qualifier="created">2002-06-10</date>
  32. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#ID-785887307"/>
  33. </metadata>
  34. <var name="doc" type="Document"/>
  35. <var name="parent" type="Element"/>
  36. <var name="oldChild" type="Element"/>
  37. <var name="newElement" type="Element"/>
  38. <var name="newText" type="Text"/>
  39. <var name="newComment" type="Comment"/>
  40. <var name="newPI" type="ProcessingInstruction"/>
  41. <var name="newCdata" type="CDATASection"/>
  42. <var name="newERef" type="EntityReference"/>
  43. <var name="replaced" type="Node"/>
  44. <var name="nodeName" type="DOMString"/>
  45. <var name="appendedChild" type="Node"/>
  46. <load var="doc" href="hc_staff" willBeModified="true"/>
  47. <createElementNS var="parent" obj="doc" namespaceURI='"http://www.w3.org/1999/xhtml"' qualifiedName='"xhtml:html"'/>
  48. <createElementNS var="oldChild" obj="doc" namespaceURI='"http://www.w3.org/1999/xhtml"' qualifiedName='"xhtml:head"'/>
  49. <createElementNS var="newElement" obj="doc" namespaceURI='"http://www.w3.org/1999/xhtml"' qualifiedName='"xhtml:body"'/>
  50. <appendChild obj="parent" var="appendedChild" newChild="oldChild"/>
  51. <appendChild obj="parent" var="appendedChild" newChild="newElement"/>
  52. <createTextNode var="newText" obj="doc" data='"Text"' />
  53. <appendChild obj="parent" var="appendedChild" newChild="newText"/>
  54. <createComment var="newComment" obj="doc" data='"Comment"' />
  55. <appendChild obj="parent" var="appendedChild" newChild="newComment"/>
  56. <createProcessingInstruction var="newPI" obj="doc" target='"target"' data='"data"' />
  57. <appendChild obj="parent" var="appendedChild" newChild="newPI"/>
  58. <createCDATASection var="newCdata" obj="doc" data='"Cdata"' />
  59. <appendChild obj="parent" var="appendedChild" newChild="newCdata"/>
  60. <createEntityReference var="newERef" obj="doc" name='"delta"' />
  61. <appendChild obj="parent" var="appendedChild" newChild="newERef"/>
  62. <replaceChild var="replaced" obj="parent" oldChild="oldChild" newChild="newElement"/>
  63. <nodeName var="nodeName" obj="replaced" />
  64. <assertEquals actual="nodeName" expected='"xhtml:head"' id="nodereplacechild30_1" ignoreCase="false"/>
  65. <replaceChild var="replaced" obj="parent" oldChild="newElement" newChild="oldChild"/>
  66. <nodeName var="nodeName" obj="replaced" />
  67. <assertEquals actual="nodeName" expected='"xhtml:body"' id="nodereplacechild30_2" ignoreCase="false"/>
  68. <replaceChild var="replaced" obj="parent" oldChild="oldChild" newChild="newText"/>
  69. <nodeName var="nodeName" obj="replaced" />
  70. <assertEquals actual="nodeName" expected='"xhtml:head"' id="nodereplacechild30_3" ignoreCase="false"/>
  71. <replaceChild var="replaced" obj="parent" oldChild="newText" newChild="oldChild"/>
  72. <nodeName var="nodeName" obj="replaced" />
  73. <assertEquals actual="nodeName" expected='"#text"' id="nodereplacechild30_4" ignoreCase="false"/>
  74. <replaceChild var="replaced" obj="parent" oldChild="oldChild" newChild="newComment"/>
  75. <nodeName var="nodeName" obj="replaced" />
  76. <assertEquals actual="nodeName" expected='"xhtml:head"' id="nodereplacechild30_5" ignoreCase="false"/>
  77. <replaceChild var="replaced" obj="parent" oldChild="newComment" newChild="oldChild"/>
  78. <nodeName var="nodeName" obj="replaced" />
  79. <assertEquals actual="nodeName" expected='"#comment"' id="nodereplacechild30_6" ignoreCase="false"/>
  80. <replaceChild var="replaced" obj="parent" oldChild="newPI" newChild="oldChild"/>
  81. <nodeName var="nodeName" obj="replaced" />
  82. <assertEquals actual="nodeName" expected='"target"' id="nodereplacechild30_7" ignoreCase="false"/>
  83. <replaceChild var="replaced" obj="parent" oldChild="newCdata" newChild="oldChild"/>
  84. <nodeName var="nodeName" obj="replaced" />
  85. <assertEquals actual="nodeName" expected='"#cdata-section"' id="nodereplacechild30_8" ignoreCase="false"/>
  86. <replaceChild var="replaced" obj="parent" oldChild="newERef" newChild="oldChild"/>
  87. <nodeName var="nodeName" obj="replaced" />
  88. <assertEquals actual="nodeName" expected='"delta"' id="nodereplacechild30_9" ignoreCase="false"/>
  89. </test>
  90.