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="setAttributeNodeNS01">
  19. <metadata>
  20. <title>setAttributeNodeNS01</title>
  21. <creator>NIST</creator>
  22. <description>
  23.     The "setAttributeNode(newAttr)" method raises an
  24.    "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr"
  25.    is already an attribute of another element.
  26.    
  27.    Retrieve the first emp:address and append
  28.    a newly created element.  The "createAttributeNS(namespaceURI,qualifiedName)"
  29.    and "setAttributeNodeNS(newAttr)" methods are invoked
  30.    to create and add a new attribute to the newly created
  31.    Element.  The "setAttributeNodeNS(newAttr)" method is
  32.    once again called to add the new attribute causing an
  33.    exception to be raised since the attribute is already
  34.    an attribute of another element.
  35. </description>
  36. <contributor>Mary Brady</contributor>
  37. <date qualifier="created">2001-08-17</date>
  38. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])"/>
  39. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS"/>
  40. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])"/>
  41. </metadata>
  42. <var name="namespaceURI" type="DOMString" value="&quot;http://www.newattr.com&quot;"/>
  43. <var name="qualifiedName" type="DOMString" value="&quot;emp:newAttr&quot;"/>
  44. <var name="doc" type="Document"/>
  45. <var name="newElement" type="Element"/>
  46. <var name="newAttr" type="Attr"/>
  47. <var name="elementList" type="NodeList"/>
  48. <var name="testAddr" type="Node"/>
  49. <var name="appendedChild" type="Node"/>
  50. <var name="setAttr1" type="Attr"/>
  51. <var name="setAttr2" type="Attr"/>
  52. <load var="doc" href="staffNS" willBeModified="true"/>
  53. <getElementsByTagName interface="Document" obj="doc" var="elementList" tagname="&quot;emp:address&quot;"/>
  54. <item interface="NodeList" obj="elementList" var="testAddr" index="0"/>
  55. <assertNotNull actual="testAddr" id="empAddrNotNull"/>
  56. <createElement obj="doc" var="newElement" tagName="&quot;newElement&quot;"/>
  57. <appendChild var="appendedChild" obj="testAddr" newChild="newElement"/>
  58. <createAttributeNS obj="doc" var="newAttr" namespaceURI="namespaceURI" qualifiedName="qualifiedName"/>
  59. <setAttributeNodeNS var="setAttr1" obj="newElement" newAttr="newAttr"/>
  60. <assertDOMException id="throw_INUSE_ATTRIBUTE_ERR">
  61. <INUSE_ATTRIBUTE_ERR>
  62. <setAttributeNodeNS var="setAttr2" obj="testAddr" newAttr="newAttr"/>
  63. </INUSE_ATTRIBUTE_ERR>
  64. </assertDOMException>
  65. </test>
  66.