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="namednodemapsetnameditem">
  15. <metadata>
  16. <title>namednodemapSetNamedItem</title>
  17. <creator>NIST</creator>
  18. <description>
  19.    The "setNamedItem(arg)" method adds a node using its
  20.   nodeName attribute.
  21.  
  22.   Retrieve the second employee and create a NamedNodeMap
  23.   object from the attributes of the last child by
  24.   invoking the "getAttributes()" method.  Once the
  25.   list is created an invocation of the "setNamedItem(arg)"
  26.   method is done with arg=newAttr, where newAttr is a
  27.   new Attr Node previously created.  The "setNamedItem(arg)"
  28.   method should add then new node to the NamedNodeItem
  29.   object by using its "nodeName" attribute("district').
  30.    This node is then retrieved using the "getNamedItem(name)"
  31.    method.  This test uses the "createAttribute(name)"
  32.    method from the document interface.
  33. </description>
  34. <contributor>Mary Brady</contributor>
  35. <date qualifier="created">2001-08-17</date>
  36. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788"/>
  37. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9"/>
  38. </metadata>
  39. <var name="doc" type="Document"/>
  40. <var name="elementList" type="NodeList"/>
  41. <var name="newAttribute" type="Attr"/>
  42. <var name="testAddress" type="Node"/>
  43. <var name="attributes" type="NamedNodeMap"/>
  44. <var name="districtNode" type="Attr"/>
  45. <var name="attrName" type="DOMString"/>
  46. <var name="setNode" type="Node"/>
  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="1"/>
  50. <createAttribute obj="doc" var="newAttribute" name="&quot;district&quot;"/>
  51. <attributes obj="testAddress" var="attributes"/>
  52. <setNamedItem var="setNode" obj="attributes" arg="newAttribute"/>
  53. <getNamedItem obj="attributes" var="districtNode" name="&quot;district&quot;"/>
  54. <nodeName obj="districtNode" var="attrName"/>
  55. <assertEquals actual="attrName" expected="&quot;district&quot;" id="namednodemapSetNamedItemAssert" ignoreCase="false"/>
  56. </test>
  57.