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 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. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="characterdatareplacedatabegining">
  14. <metadata>
  15. <title>characterdataReplaceDataBeginning</title>
  16. <creator>NIST</creator>
  17. <description>
  18. The "replaceData(offset,count,arg)" method replaces the
  19. characters starting at the specified offset with the
  20. specified string.  Test for replacement in the
  21. middle of the data.
  22.  
  23. Retrieve the character data from the last child of the
  24. first employee.  The "replaceData(offset,count,arg)"
  25. method is then called with offset=5 and count=5 and
  26. arg="South".  The method should replace characters five
  27. thru 9 of the character data with "South".
  28. </description>
  29. <contributor>Mary Brady</contributor>
  30. <date qualifier="created">2001-08-17</date>
  31. <!--replaceData-->
  32. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB"/>
  33. </metadata>
  34. <var name="doc" type="Document"/>
  35. <var name="elementList" type="NodeList"/>
  36. <var name="nameNode" type="Node"/>
  37. <var name="child" type="CharacterData"/>
  38. <var name="childData" type="DOMString"/>
  39. <load var="doc" href="staff" willBeModified="true"/>
  40. <getElementsByTagName interface="Document" obj="doc" tagname="&quot;address&quot;" var="elementList"/>
  41. <item interface="NodeList" obj="elementList" index="0" var="nameNode"/>
  42. <firstChild interface="Node" obj="nameNode" var="child"/>
  43. <replaceData obj="child" offset="0" count="4" arg="&quot;2500&quot;"/>
  44. <data interface="CharacterData" obj="child" var="childData"/>
  45. <assertEquals actual="childData" expected="&quot;2500 North Ave. Dallas, Texas 98551&quot;" id="characterdataReplaceDataBeginingAssert" ignoreCase="false"/>
  46. </test>
  47.