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-2003 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="importNode07">
  19. <metadata>
  20. <title>importNode07</title>
  21. <creator>NIST</creator>
  22. <description>
  23.     The "importNode(importedNode,deep)" method for a
  24.    Document should import the given importedNode into that Document.
  25.    The importedNode is of type Element.
  26.    If this document defines default attributes for this element name (importedNode),
  27.    those default attributes are assigned.
  28.    
  29.    Create an element whose name is "emp:employee" in a different document.
  30.    Invoke method importNode(importedNode,deep) on this document which
  31.    defines default attribute for the element name "emp:employee".
  32.    Method should return an the imported element with an assigned default attribute.
  33. </description>
  34. <contributor>Mary Brady</contributor>
  35. <date qualifier="created">2001-08-17</date>
  36. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode"/>
  37. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238"/>
  38. </metadata>
  39. <implementationAttribute name="namespaceAware" value="true"/>
  40. <implementationAttribute name="validating" value="true"/>
  41. <var name="doc" type="Document"/>
  42. <var name="aNewDoc" type="Document"/>
  43. <var name="element" type="Element"/>
  44. <var name="aNode" type="Node"/>
  45. <var name="attributes" type="NamedNodeMap"/>
  46. <var name="name" type="DOMString"/>
  47. <var name="attr" type="Node"/>
  48. <var name="lname" type="DOMString"/>
  49. <var name="namespaceURI" type="DOMString" value='"http://www.nist.gov"'/>
  50. <var name="qualifiedName" type="DOMString" value='"emp:employee"'/>
  51. <load var="doc" href="staffNS" willBeModified="true"/>
  52. <load var="aNewDoc" href="staff" willBeModified="true"/>
  53. <createElementNS obj="aNewDoc" var="element" namespaceURI="namespaceURI" qualifiedName="qualifiedName"/>
  54. <importNode obj="doc" var="aNode" importedNode="element" deep="false"/>
  55. <attributes obj="aNode" var="attributes"/>
  56. <assertSize collection="attributes" size="1" id="throw_Size"/>
  57. <nodeName obj="aNode" var="name"/>
  58. <assertEquals actual="name" expected='"emp:employee"' ignoreCase="false" id="nodeName"/>
  59. <item interface="NamedNodeMap" obj="attributes" var="attr" index="0"/>
  60. <localName obj="attr" var="lname"/>
  61. <assertEquals actual="lname" expected='"defaultAttr"' ignoreCase="false" id="lname"/>
  62. </test>
  63.