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="elementinuseattributeerr">
  15. <metadata>
  16. <title>elementInUseAttributeErr</title>
  17. <creator>NIST</creator>
  18. <description>
  19.    The "setAttributeNode(newAttr)" method raises an
  20.   "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr"
  21.   is already an attribute of another element.
  22.  
  23.   Retrieve the last child of the second employee and append
  24.   a newly created element.  The "createAttribute(name)"
  25.   and "setAttributeNode(newAttr)" methods are invoked
  26.   to create and add a new attribute to the newly created
  27.   Element.  The "setAttributeNode(newAttr)" method is
  28.   once again called to add the new attribute causing an
  29.   exception to be raised since the attribute is already
  30.   an attribute of another element.
  31. </description>
  32. <contributor>Mary Brady</contributor>
  33. <date qualifier="created">2001-08-17</date>
  34. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR'])"/>
  35. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154"/>
  36. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])"/>
  37. </metadata>
  38. <var name="doc" type="Document"/>
  39. <var name="newAttribute" type="Attr"/>
  40. <var name="addressElementList" type="NodeList"/>
  41. <var name="testAddress" type="Element"/>
  42. <var name="newElement" type="Element"/>
  43. <var name="appendedChild" type="Node"/>
  44. <var name="setAttr1" type="Attr"/>
  45. <var name="setAttr2" type="Attr"/>
  46. <load var="doc" href="staff" willBeModified="true"/>
  47. <getElementsByTagName interface="Document" obj="doc" tagname='"address"' var="addressElementList"/>
  48. <item interface="NodeList" obj="addressElementList" index="1" var="testAddress"/>
  49. <createElement obj="doc" var="newElement" tagName='"newElement"'/>
  50. <appendChild var="appendedChild" obj="testAddress" newChild="newElement"/>
  51. <createAttribute obj="doc" var="newAttribute" name='"newAttribute"'/>
  52. <setAttributeNode var="setAttr1" obj="newElement" newAttr="newAttribute"/>
  53. <assertDOMException id="throw_INUSE_ATTRIBUTE_ERR">
  54.    <INUSE_ATTRIBUTE_ERR>
  55.        <setAttributeNode var="setAttr2" obj="testAddress" newAttr="newAttribute"/>
  56.    </INUSE_ATTRIBUTE_ERR>
  57. </assertDOMException>
  58. </test>
  59.