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="noderemovechild19">
  20. <metadata>
  21. <title>noderemovechild19</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         Using removeChild on the first 'p' Element node attempt to remove a EntityReference
  25.         node child and verify the nodeName of the returned node that was removed.  Attempt
  26.         to remove a non-child from an entity reference and expect either a NOT_FOUND_ERR or
  27.         a NO_MODIFICATION_ALLOWED_ERR.  Renove a child from an entity reference and expect
  28.         a NO_MODIFICATION_ALLOWED_ERR.
  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-1734834066"/>
  33. </metadata>
  34. <implementationAttribute name="expandEntityReferences" value="false"/>
  35. <var name="doc" type="Document"/>
  36. <var name="parentList" type="NodeList"/>
  37. <var name="parent" type="Element"/>
  38. <var name="child" type="EntityReference"/>
  39. <var name="removed" type="EntityReference"/>
  40. <var name="removedName" type="DOMString"/>
  41. <var name="removedNode" type="Node"/>
  42. <var name="entRefChild" type="Node"/>
  43. <load var="doc" href="hc_staff" willBeModified="true"/>
  44. <getElementsByTagName var="parentList" obj="doc" tagname='"acronym"' interface="Document"/>
  45. <item var="parent" obj="parentList" index="1" interface="NodeList"/>
  46. <firstChild var="child" obj="parent" interface="Node"/>
  47. <removeChild var="removed"  obj="parent" oldChild="child" />
  48. <nodeName obj="removed" var="removedName"/>
  49. <assertEquals actual="removedName" expected='"beta"' id="noderemovechild19" ignoreCase="false"/>
  50. <!--  
  51.   Remove a non-member of the entity reference,
  52.   expect either a NO_MODIFICATION_ALLOWED_ERR or a NOT_FOUND_ERR
  53. -->
  54. <try>
  55.         <removeChild obj="child" var="removedNode" oldChild="parent" />
  56.         <fail id="throw_DOMException"/>
  57.         <catch>
  58.                 <DOMException code="NO_MODIFICATION_ALLOWED_ERR"/>
  59.                 <DOMException code="NOT_FOUND_ERR"/>
  60.         </catch>
  61. </try>
  62. <!--
  63. Remove a child of the entity reference
  64.   Expect a NO_MODIFICATION_ALLOWED_ERR exception
  65. -->  
  66. <firstChild var="entRefChild" obj="child" interface="Node"/>
  67. <if>
  68.    <!-- entity may not be resolved if validating is false  -->
  69.         <notNull obj="entRefChild"/>
  70.         <assertDOMException id="throw_NO_MODIFICATION_ALLOWED_ERR">
  71.                 <NO_MODIFICATION_ALLOWED_ERR>
  72.                         <removeChild obj="child" var="removedNode" oldChild="entRefChild"/>
  73.                 </NO_MODIFICATION_ALLOWED_ERR>
  74.         </assertDOMException>
  75. </if>
  76. </test>
  77.