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. <!DOCTYPE test SYSTEM "dom2.dtd">
  18. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-2" name="setAttributeNS03">
  19. <metadata>
  20. <title>setAttributeNS03</title>
  21. <creator>NIST</creator>
  22. <description>
  23.     The "setAttributeNS(namespaceURI,qualifiedName,value)" method for an attribute causes the
  24.    DOMException NO_MODIFICATION_ALLOWED_ERR to be raised
  25.    if the node is readonly.
  26.    
  27.    Obtain the children of the THIRD "gender" element.  The elements
  28.    content is an entity reference.  Try to set an attribute
  29.    in the entity reference by executing the
  30.    "setAttributeNS(namespaceURI,qualifiedName,value)" method.
  31.    This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown.
  32. </description>
  33. <contributor>Mary Brady</contributor>
  34. <date qualifier="created">2001-08-17</date>
  35. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='NO_MODIFICATION_ALLOWED_ERR'])"/>
  36. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS"/>
  37. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])"/>
  38. </metadata>
  39. <var name="namespaceURI" type="DOMString" value="&quot;www.xyz.com&quot;"/>
  40. <var name="qualifiedName" type="DOMString" value="&quot;emp:local1&quot;"/>
  41. <var name="doc" type="Document"/>
  42. <var name="genderList" type="NodeList"/>
  43. <var name="gender" type="Node"/>
  44. <var name="genList" type="NodeList"/>
  45. <var name="gen" type="Node"/>
  46. <var name="gList" type="NodeList"/>
  47. <var name="genElement" type="Element"/>
  48. <var name="nodeType" type="int"/>
  49. <load var="doc" href="staffNS" willBeModified="true"/>
  50. <getElementsByTagName interface="Document" obj="doc" var="genderList" tagname="&quot;gender&quot;"/>
  51. <item interface="NodeList" obj="genderList" var="gender" index="2"/>
  52. <childNodes obj="gender" var="genList"/>
  53. <item interface="NodeList" obj="genList" var="gen" index="0"/>
  54. <nodeType var="nodeType" obj="gen"/>
  55. <if><equals actual="nodeType" expected="1" ignoreCase="false"/>
  56.         <createEntityReference var="gen" name='"ent4"' obj="doc"/>
  57.         <assertNotNull actual="gen" id="createdEntRefNotNull"/>
  58. </if>
  59. <childNodes obj="gen" var="gList"/>
  60. <item interface="NodeList" obj="gList" var="genElement" index="0"/>
  61. <assertNotNull actual="genElement" id="notnull"/>
  62. <assertDOMException id="throw_NO_MODIFICATION_ALLOWED_ERR">
  63. <NO_MODIFICATION_ALLOWED_ERR>
  64. <setAttributeNS obj="genElement" namespaceURI="namespaceURI" qualifiedName="qualifiedName" value="&quot;newValue&quot;"/>
  65. </NO_MODIFICATION_ALLOWED_ERR>
  66. </assertDOMException>
  67. </test>
  68.