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-2003 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="hc_nodechildnodes">
  15. <metadata>
  16. <title>hc_nodeChildNodes</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19.    
  20.    The "getChildNodes()" method returns a NodeList
  21.    that contains all children of this node.
  22.    
  23.    Retrieve the second employee and check the NodeList
  24.    returned by the "getChildNodes()" method.   The
  25.    length of the list should be 13.
  26. </description>
  27.  
  28. <date qualifier="created">2002-06-09</date>
  29. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987"/>
  30. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=246"/>
  31. </metadata>
  32. <var name="doc" type="Document"/>
  33. <var name="elementList" type="NodeList"/>
  34. <var name="employeeNode" type="Node"/>
  35. <var name="childNode" type="Node"/>
  36. <var name="childNodes" type="NodeList"/>
  37. <var name="nodeType" type="int"/>
  38. <var name="childName" type="DOMString"/>
  39. <var name="actual" type="List"/>
  40. <var name="expected" type="List">
  41. <member>"em"</member>
  42. <member>"strong"</member>
  43. <member>"code"</member>
  44. <member>"sup"</member>
  45. <member>"var"</member>
  46. <member>"acronym"</member>
  47. </var>
  48. <load var="doc" href="hc_staff" willBeModified="false"/>
  49. <getElementsByTagName interface="Document" obj="doc" tagname='"p"' var="elementList"/>
  50. <item interface="NodeList" obj="elementList" index="1" var="employeeNode"/>
  51. <childNodes obj="employeeNode" var="childNodes"/>
  52. <for-each collection="childNodes" member="childNode">
  53.    <nodeType var="nodeType" obj="childNode"/>
  54.    <nodeName var="childName" obj="childNode"/>
  55.    <if><equals actual="nodeType" expected="1"/>
  56.        <append collection="actual" item="childName"/>
  57.        <else>
  58.            <assertEquals actual="nodeType" expected="3" ignoreCase="false" id="textNodeType"/>
  59.        </else>
  60.    </if>
  61. </for-each>
  62. <assertEquals actual="actual" expected="expected" id="elementNames" ignoreCase="auto"/>
  63. </test>
  64.