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="noderemovechild31">
  20. <metadata>
  21. <title>noderemovechild31</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         Using removeChild on a default Attribute node attempt to remove its EntityReference child node and
  25.         and verify the name of the returned node that was removed.  Now attempt the reverse
  26.         and verify if a NO_MODIFICATION_ALLOWED_ERR or NOT_FOUND_ERR is thrown.
  27.         Then remove an child of the entity reference and expect a NO_MODIFICATION_ALLOWED_ERR.
  28. </description>
  29. <contributor>Neil Delima</contributor>
  30. <date qualifier="created">2002-06-10</date>
  31. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#ID-1734834066"/>
  32. </metadata>
  33. <implementationAttribute name="expandEntityReferences" value="false"/>
  34. <var name="doc" type="Document"/>
  35. <var name="parentList" type="NodeList"/>
  36. <var name="attrsMap" type="NamedNodeMap"/>
  37. <var name="parent" type="Attr"/>
  38. <var name="child" type="EntityReference"/>
  39. <var name="entRef" type="EntityReference"/>
  40. <var name="elem" type="Element"/>
  41. <var name="removed" type="EntityReference"/>
  42. <var name="removedNode" type="Node"/>
  43. <var name="removedName" type="DOMString"/>
  44. <var name="appendedChild" type="Node"/>
  45. <var name="entRefChild" type="Node"/>
  46. <load var="doc" href="hc_staff" willBeModified="true"/>
  47. <getElementsByTagName var="parentList" obj="doc" tagname='"acronym"' interface="Document"/>
  48. <item var="elem" obj="parentList" index="3" interface="NodeList"/>
  49. <attributes var="attrsMap" obj="elem"/>
  50. <getNamedItem var="parent" obj="attrsMap" name='"class"'/>
  51. <createEntityReference var="entRef" obj="doc" name='"delta"'/>
  52. <appendChild obj="parent" var="appendedChild" newChild="entRef"/>
  53. <lastChild var="child" obj="parent" interface="Node"/>
  54. <removeChild var="removed"  obj="parent" oldChild="child" />
  55. <nodeName obj="removed" var="removedName"/>
  56. <assertEquals actual="removedName" expected='"delta"' id="noderemovechild31" ignoreCase="false"/>
  57. <!--
  58. Remove a non-child from an entity reference
  59. Should throw either a NO_MODIFICATION_ALLOWED_ERR or a NOT_FOUND_ERR
  60. -->
  61. <try>
  62.         <removeChild obj="child" var="removedNode" oldChild="parent" />
  63.         <fail id="throw_DOMException"/>
  64.         <catch>
  65.                 <DOMException code="NO_MODIFICATION_ALLOWED_ERR"/>
  66.                 <DOMException code="NOT_FOUND_ERR"/>
  67.         </catch>
  68. </try>
  69. <!--
  70. Remove a child of the entity reference
  71.   Expect a NO_MODIFICATION_ALLOWED_ERR exception
  72. -->  
  73. <firstChild var="entRefChild" obj="child" interface="Node"/>
  74. <if>
  75.    <!-- entity may not be resolved if validating is false  -->
  76.         <notNull obj="entRefChild"/>
  77.         <assertDOMException id="throw_NO_MODIFICATION_ALLOWED_ERR">
  78.                 <NO_MODIFICATION_ALLOWED_ERR>
  79.                         <removeChild obj="child" var="removedNode" oldChild="entRefChild"/>
  80.                 </NO_MODIFICATION_ALLOWED_ERR>
  81.         </assertDOMException>
  82. </if>
  83.  
  84. </test>
  85.