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.  
  14. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="nodereplacechildnomodificationallowederr">
  15. <metadata>
  16. <title>nodeReplaceChildNoModificationAllowedErr</title>
  17. <creator>NIST</creator>
  18. <description>
  19.    The "replaceChild(newChild,oldChild)" method causes the
  20.    DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
  21.    if the node is readonly.
  22.    
  23.    Obtain the children of the THIRD "gender" element.   The elements
  24.    content is an entity reference.   Get the FIRST item
  25.    from the entity reference and execute the "replaceChild(newChild,oldChild)" method.
  26.    This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
  27. </description>
  28. <contributor>Mary Brady</contributor>
  29. <contributor>Curt Arnold</contributor>
  30. <date qualifier="created">2001-08-22</date>
  31. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])"/>
  32. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307"/>
  33. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])"/>
  34. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307"/>
  35. </metadata>
  36. <var name="doc" type="Document"/>
  37. <var name="genderList" type="NodeList"/>
  38. <var name="genderNode" type="Node"/>
  39. <var name="entRef" type="Node"/>
  40. <var name="entElement" type="Node"/>
  41. <var name="createdNode" type="Node"/>
  42. <var name="replacedChild" type="Node"/>
  43. <var name="nodeType" type="int"/>
  44. <load var="doc" href="staff" willBeModified="true"/>
  45. <getElementsByTagName interface="Document" obj="doc" tagname="&quot;gender&quot;" var="genderList"/>
  46. <item obj="genderList" index="2" var="genderNode" interface="NodeList"/>
  47. <firstChild interface="Node" var="entRef" obj="genderNode"/>
  48. <nodeType var="nodeType" obj="entRef"/>
  49. <if><equals actual="nodeType" expected="1" ignoreCase="false"/>
  50.         <createEntityReference var="entRef" obj="doc" name='"ent4"'/>
  51.         <assertNotNull actual="entRef" id="createdEntRefNotNull"/>     
  52. </if>
  53. <firstChild interface="Node" var="entElement" obj="entRef"/>
  54. <createElement obj="doc" tagName="&quot;newChild&quot;" var="createdNode"/>
  55. <assertDOMException id="throw_NO_MODIFICATION_ALLOWED_ERR">
  56. <NO_MODIFICATION_ALLOWED_ERR>
  57. <replaceChild var="replacedChild" obj="entRef" newChild="createdNode" oldChild="entElement"/>
  58. </NO_MODIFICATION_ALLOWED_ERR>
  59. </assertDOMException>
  60. </test>
  61.