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 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="importNode01">
  19. <metadata>
  20. <title>importNode01</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 Attr.
  26.    The ownerElement is set to null. Specified flag is set to true.
  27.    Children is imported.
  28.    
  29.    Create a new attribute whose name is "elem:attr1" in a different document.
  30.    Create a child Text node with value "importedText" for the attribute node above.
  31.    Invoke method importNode(importedNode,deep) on this document with
  32.    importedNode being the newly created attribute.
  33.    Method should return a node whose name matches "elem:attr1" and a child node
  34.    whose value equals "importedText".
  35.    The returned node should belong to this document whose systemId is "staff.dtd"
  36. </description>
  37. <contributor>Mary Brady</contributor>
  38. <date qualifier="created">2001-08-17</date>
  39. <subject resource="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode"/>
  40. </metadata>
  41. <var name="doc" type="Document"/>
  42. <var name="aNewDoc" type="Document"/>
  43. <var name="newAttr" type="Attr"/>
  44. <var name="importedChild" type="Text"/>
  45. <var name="aNode" type="Node"/>
  46. <var name="ownerDocument" type="Document"/>
  47. <var name="attrOwnerElement" type="Element"/>
  48. <var name="docType" type="DocumentType"/>
  49. <var name="system" type="DOMString"/>
  50. <var name="specified" type="boolean"/>
  51. <var name="childList" type="NodeList"/>
  52. <var name="nodeName" type="DOMString"/>
  53. <var name="child" type="Node"/>
  54. <var name="childValue" type="DOMString"/>
  55. <var name="result" type="List"/>
  56. <var name="expectedResult" type="List">
  57. <member>"elem:attr1"</member>
  58. <member>"importedText"</member>
  59. </var>
  60. <load var="doc" href="staffNS" willBeModified="true"/>
  61. <load var="aNewDoc" href="staffNS" willBeModified="true"/>
  62. <createAttribute obj="aNewDoc" var="newAttr" name='"elem:attr1"'/>
  63. <createTextNode obj="aNewDoc" var="importedChild" data='"importedText"'/>
  64. <appendChild obj="newAttr" var="aNode" newChild="importedChild"/>
  65. <importNode obj="doc" var="aNode" importedNode="newAttr" deep="false"/>
  66. <ownerDocument obj="aNode" var="ownerDocument"/>
  67. <doctype obj="ownerDocument" var="docType"/>
  68. <systemId interface="DocumentType" obj="docType" var="system"/>
  69. <assertNotNull actual="aNode" id="aNode"/>
  70. <assertURIEquals actual="system" file='"staffNS.dtd"' id="systemId"/>
  71. <ownerElement obj="aNode" var="attrOwnerElement"/>
  72. <assertNull actual="attrOwnerElement" id="ownerElement"/>
  73. <specified obj="aNode" var="specified"/>
  74. <assertTrue actual="specified" id="specified"/>
  75. <childNodes obj="aNode" var="childList"/>
  76. <assertSize collection="childList" size="1" id="childList"/>
  77. <nodeName obj="aNode" var="nodeName"/>
  78. <assertEquals actual="nodeName" id="nodeName" ignoreCase="false" expected='"elem:attr1"'/>
  79. <firstChild interface="Node" obj="aNode" var="child"/>
  80. <nodeValue obj="child" var="childValue"/>
  81. <assertEquals actual="childValue" id="childValue" ignoreCase="false" expected='"importedText"'/>
  82. </test>
  83.