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="setAttributeNS05">
  19. <metadata>
  20. <title>setAttributeNS05</title>
  21. <creator>NIST</creator>
  22. <description>
  23.     The "setAttributeNS(namespaceURI,qualifiedName,value)" method adds a new attribute.
  24.    If an attribute with the same local name and namespace URI is already present
  25.    on the element, its prefix is changed to be the prefix part of the "qualifiedName",
  26.    and its vale is changed to be the "value" paramter.
  27.    null value if no previously existing Attr node with the
  28.    same name was replaced.
  29.    
  30.    Add a new attribute to the "emp:address" element.
  31.    Check to see if the new attribute has been successfully added to the document.
  32.    The new attribute "&lt;newValue&gt;" contains markup and therefore is escaped
  33.    by the implementation.
  34. </description>
  35. <contributor>Mary Brady</contributor>
  36. <date qualifier="created">2001-08-17</date>
  37. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS"/>
  38. </metadata>
  39. <var name="localName" type="DOMString" value="&quot;newAttr&quot;"/>
  40. <var name="namespaceURI" type="DOMString" value="&quot;http://www.newattr.com&quot;"/>
  41. <var name="qualifiedName" type="DOMString" value="&quot;emp:newAttr&quot;"/>
  42. <var name="doc" type="Document"/>
  43. <var name="elementList" type="NodeList"/>
  44. <var name="testAddr" type="Node"/>
  45. <var name="addrAttr" type="Attr"/>
  46. <var name="resultAttr" type="DOMString"/>
  47. <load var="doc" href="staffNS" willBeModified="true"/>
  48. <getElementsByTagName interface="Document" obj="doc" var="elementList" tagname="&quot;emp:address&quot;"/>
  49. <item interface="NodeList" obj="elementList" var="testAddr" index="0"/>
  50. <assertNotNull actual="testAddr" id="empAddrNotNull"/>
  51. <setAttributeNS obj="testAddr" namespaceURI="namespaceURI" qualifiedName="qualifiedName" value="&quot;&lt;newValue&gt;&quot;"/>
  52. <getAttributeNS obj="testAddr" var="resultAttr" namespaceURI="namespaceURI" localName="localName"/>
  53. <assertEquals actual="resultAttr" expected="&quot;&lt;newValue&gt;&quot;" id="throw_Equals" ignoreCase="false"/>
  54. </test>
  55.