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"?>
  2. <!--
  3. Copyright (c) 2001-2004 World Wide Web Consortium,
  4. (Massachusetts Institute of Technology, Institut National de
  5. Recherche en Informatique et en Automatique, Keio University). All
  6. Rights Reserved. This program is distributed under the W3C's Software
  7. Intellectual Property License. This program is distributed in the
  8. hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  9. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  10. PURPOSE.
  11. See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  12. --><!DOCTYPE test SYSTEM "dom1.dtd">
  13.  
  14. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="noderemovechildnode">
  15. <metadata>
  16. <title>nodeRemoveChildNode</title>
  17. <creator>NIST</creator>
  18. <description>
  19.     Retrieve the second employee and remove its first child.
  20.     After the removal, the second employee should have five or twelve
  21.     children and the first child should now be the child
  22.     that used to be at the second position in the list.
  23. </description>
  24. <contributor>Mary Brady</contributor>
  25. <date qualifier="created">2001-08-17</date>
  26. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066"/>
  27. </metadata>
  28. <var name="doc" type="Document"/>
  29. <var name="elementList" type="NodeList"/>
  30. <var name="employeeNode" type="Node"/>
  31. <var name="childList" type="NodeList"/>
  32. <var name="oldChild" type="Node"/>
  33. <var name="child" type="Node"/>
  34. <var name="childName" type="DOMString"/>
  35. <var name="length" type="int"/>
  36. <var name="removedChild" type="Node"/>
  37. <var name="removedName" type="DOMString"/>
  38. <load var="doc" href="staff" willBeModified="true"/>
  39. <getElementsByTagName interface="Document" obj="doc" tagname="&quot;employee&quot;" var="elementList"/>
  40. <item interface="NodeList" obj="elementList" index="1" var="employeeNode"/>
  41. <childNodes obj="employeeNode" var="childList"/>
  42. <item interface="NodeList" obj="childList" index="0" var="oldChild"/>
  43. <removeChild var="removedChild" obj="employeeNode" oldChild="oldChild"/>
  44. <nodeName obj="removedChild" var="removedName"/>
  45. <item interface="NodeList" obj="childList" index="0" var="child"/>
  46. <nodeName obj="child" var="childName"/>
  47. <length interface="NodeList" obj="childList" var="length"/>
  48. <if><equals actual="length" expected="5" ignoreCase="false"/>
  49.         <assertEquals actual="removedName" expected='"employeeId"' ignoreCase="false" id="removedNameNoWhitespace"/>
  50.         <assertEquals actual="childName" expected='"name"' ignoreCase="false" id="childNameNoWhitespace"/>
  51. <else>
  52.         <assertEquals actual="removedName" expected='"#text"' ignoreCase="false" id="removedName"/>
  53.         <assertEquals actual="childName" expected='"employeeId"' ignoreCase="false" id="childName"/>
  54.         <assertEquals actual="length" expected="12" ignoreCase="false" id="length"/>
  55. </else>
  56. </if>
  57. </test>
  58.