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 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="setAttributeNodeNS05">
  19. <metadata>
  20. <title>setAttributeNodeNS05</title>
  21. <creator>NIST</creator>
  22. <description>
  23.     The "setAttributeNodeNS(newAttr)" method raises an
  24.    "WRONG_DOCUMENT_ERR DOMException if the "newAttr"
  25.    was created from a different document than the one that
  26.    created this document.
  27.    
  28.    Retrieve the first emp:address and attempt to set a new
  29.    attribute node.  The new
  30.    attribute was created from a document other than the
  31.    one that created this element, therefore a
  32.    WRONG_DOCUMENT_ERR DOMException should be raised.
  33.    This test uses the "createAttributeNS(newAttr)" method
  34.    from the Document interface.
  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='WRONG_DOCUMENT_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(.,':')='WRONG_DOCUMENT_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="doc1" type="Document"/>
  45. <var name="doc2" type="Document"/>
  46. <var name="newAttr" type="Attr"/>
  47. <var name="elementList" type="NodeList"/>
  48. <var name="testAddr" type="Node"/>
  49. <var name="setAttr1" type="Attr"/>
  50. <load var="doc1" href="staffNS" willBeModified="true"/>
  51. <load var="doc2" href="staffNS" willBeModified="true"/>
  52. <createAttributeNS obj="doc2" var="newAttr" namespaceURI="namespaceURI" qualifiedName="qualifiedName"/>
  53. <getElementsByTagName interface="Document" obj="doc1" var="elementList" tagname="&quot;emp:address&quot;"/>
  54. <item interface="NodeList" obj="elementList" var="testAddr" index="0"/>
  55. <assertDOMException id="throw_WRONG_DOCUMENT_ERR">
  56. <WRONG_DOCUMENT_ERR>
  57. <setAttributeNodeNS var="setAttr1" obj="testAddr" newAttr="newAttr"/>
  58. </WRONG_DOCUMENT_ERR>
  59. </assertDOMException>
  60. </test>
  61.