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="namednodemapsetnameditemreturnvalue">
  15. <metadata>
  16. <title>namednodemapSetNamedItemReturnValue</title>
  17. <creator>NIST</creator>
  18. <description>
  19.    If the "setNamedItem(arg)" method replaces an already
  20.   existing node with the same name then the already
  21.   existing node is returned.
  22.  
  23.   Retrieve the third employee and create a NamedNodeMap
  24.   object from the attributes of the last child by
  25.   invoking the "getAttributes()" method.  Once the
  26.   list is created an invocation of the "setNamedItem(arg)"
  27.   method is done with arg=newAttr, where newAttr is a
  28.   new Attr Node previously created and whose node name
  29.   already exists in the map.  The "setNamedItem(arg)"
  30.   method should replace the already existing node with
  31.   the new one and return the existing node.  
  32.   This test uses the "createAttribute(name)" method from
  33.   the document interface.
  34. </description>
  35. <contributor>Mary Brady</contributor>
  36. <date qualifier="created">2001-08-17</date>
  37. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788"/>
  38. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9"/>
  39. </metadata>
  40. <var name="doc" type="Document"/>
  41. <var name="elementList" type="NodeList"/>
  42. <var name="newAttribute" type="Attr"/>
  43. <var name="testAddress" type="Node"/>
  44. <var name="attributes" type="NamedNodeMap"/>
  45. <var name="newNode" type="Node"/>
  46. <var name="attrValue" type="DOMString"/>
  47. <load var="doc" href="staff" willBeModified="true"/>
  48. <getElementsByTagName interface="Document" obj="doc" var="elementList" tagname="&quot;address&quot;"/>
  49. <item interface="NodeList" obj="elementList" var="testAddress" index="2"/>
  50. <createAttribute obj="doc" var="newAttribute" name="&quot;street&quot;"/>
  51. <attributes obj="testAddress" var="attributes"/>
  52. <setNamedItem interface="NamedNodeMap" obj="attributes" var="newNode" arg="newAttribute"/>
  53. <nodeValue obj="newNode" var="attrValue"/>
  54. <assertEquals actual="attrValue" expected="&quot;No&quot;"
  55.         id="returnedNodeValue" ignoreCase="false"/>
  56. </test>
  57.