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="hc_textparseintolistofelements">
  15. <metadata>
  16. <title>hc_textParseIntoListOfElements</title>
  17. <creator>Curt Arnold</creator>
  18. <description>
  19.     Retrieve the textual data from the last child of the
  20.     second employee.   That node is composed of two  
  21.     EntityReference nodes and two Text nodes.   After
  22.     the content node is parsed, the "acronym" Element
  23.     should contain four children with each one of the
  24.     EntityReferences containing one child.
  25. </description>
  26.  
  27. <date qualifier="created">2002-06-09</date>
  28. <!--childNodes attribute -->
  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/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490"/>
  31. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614"/>
  32. </metadata>
  33. <var name="doc" type="Document"/>
  34. <var name="elementList" type="NodeList"/>
  35. <var name="addressNode" type="Node"/>
  36. <var name="childList" type="NodeList"/>
  37. <var name="child" type="Node"/>
  38. <var name="value" type="DOMString"/>
  39. <var name="grandChild" type="Node"/>
  40. <var name="length" type="int"/>
  41. <var name="result" type="List"/>
  42. <var name="expectedNormal" type="List">
  43. <member>"&#946;"</member>
  44. <member>" Dallas, "</member>
  45. <member>"&#947;"</member>
  46. <member>"\n 98554"</member>
  47. </var>
  48. <var name="expectedExpanded" type="List">
  49. <member>"&#946; Dallas, &#947;\n 98554"</member>
  50. </var>
  51. <load var="doc" href="hc_staff" willBeModified="false"/>
  52. <getElementsByTagName interface="Document" obj="doc" var="elementList" tagname='"acronym"'/>
  53. <item interface="NodeList" obj="elementList" var="addressNode" index="1"/>
  54. <childNodes obj="addressNode" var="childList"/>
  55. <length var="length" obj="childList" interface="NodeList"/>
  56. <for-each collection="childList" member="child">
  57.         <nodeValue obj="child" var="value"/>
  58.         <if>
  59.                 <isNull obj="value"/>
  60.                 <firstChild interface="Node" obj="child" var="grandChild"/>
  61.                 <assertNotNull actual="grandChild" id="grandChildNotNull"/>
  62.                 <nodeValue obj="grandChild" var="value"/>
  63.                 <append collection="result" item="value"/>
  64.                 <else>
  65.                         <append collection="result" item="value"/>
  66.                 </else>
  67.         </if>
  68. </for-each>
  69. <if><equals actual="length" expected="1" ignoreCase="false"/>
  70.         <assertEquals actual="result" expected="expectedExpanded" ignoreCase="false" id="assertEqCoalescing"/>
  71.         <else>
  72.                 <assertEquals actual="result" expected="expectedNormal" ignoreCase="false" id="assertEqNormal"/>
  73.         </else>
  74. </if>
  75. </test>
  76.