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="nodecloneattributescopied">
  15. <metadata>
  16. <title>nodeCloneAttributesCopied</title>
  17. <creator>NIST</creator>
  18. <description>
  19.     If the cloneNode method is used to clone an
  20.     Element node, all the attributes of the Element are
  21.     copied along with their values.
  22.    
  23.     Retrieve the last child of the second employee and invoke
  24.     the cloneNode method.   The
  25.     duplicate node returned by the method should copy the
  26.     attributes associated with this node.
  27. </description>
  28. <contributor>Mary Brady</contributor>
  29. <date qualifier="created">2001-08-17</date>
  30. <subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096"/>
  31. </metadata>
  32. <var name="doc" type="Document"/>
  33. <var name="elementList" type="NodeList"/>
  34. <var name="addressNode" type="Node"/>
  35. <var name="clonedNode" type="Node"/>
  36. <var name="attributes" type="NamedNodeMap"/>
  37. <var name="attributeNode" type="Node"/>
  38. <var name="attributeName" type="DOMString"/>
  39. <var name="result" type="Collection"/>
  40. <var name="expectedResult" type="Collection">
  41. <member>"domestic"</member>
  42. <member>"street"</member>
  43. </var>
  44. <load var="doc" href="staff" willBeModified="true"/>
  45. <getElementsByTagName interface="Document" obj="doc" tagname="&quot;address&quot;" var="elementList"/>
  46. <item interface="NodeList" obj="elementList" index="1" var="addressNode"/>
  47. <cloneNode obj="addressNode" deep="false" var="clonedNode"/>
  48. <attributes obj="clonedNode" var="attributes"/>
  49. <for-each collection="attributes" member="attributeNode">
  50. <nodeName obj="attributeNode" var="attributeName"/>
  51. <append collection="result" item="attributeName"/>
  52. </for-each>
  53. <assertEquals actual="result" expected="expectedResult" id="nodeCloneAttributesCopiedAssert1" ignoreCase="false"/>
  54. </test>
  55.