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-2004 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.  
  18. <!DOCTYPE test SYSTEM "dom3.dtd">
  19. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="nodeisequalnode11">
  20. <metadata>
  21. <title>nodeisequalnode11</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         Retreive the first element node whose localName is "p".  Import it into a new
  25.         Document with deep=false.  Using isEqualNode check if the original and the imported
  26.         Element Node are not equal the child nodes are different.
  27.         Import with deep and the should still be unequal if
  28.         validating since the
  29.         new document does not provide the same default attributes.
  30.         Import it into another instance of the source document
  31.         and then the imported node and the source should be equal.  
  32. </description>
  33. <contributor>Neil Delima</contributor>
  34. <date qualifier="created">2002-06-10</date>
  35. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isEqualNode"/>
  36. <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=529"/>
  37. </metadata>
  38. <var name="doc" type="Document"/>
  39. <var name="domImpl" type="DOMImplementation"/>
  40. <var name="employeeList" type="NodeList"/>
  41. <var name="newDoc" type="Document"/>
  42. <var name="dupDoc" type="Document"/>
  43. <var name="elem1" type="Element"/>
  44. <var name="elem2" type="Element"/>
  45. <var name="elem3" type="Element"/>
  46. <var name="elem4" type="Element"/>
  47. <var name="isEqual" type="boolean"/>
  48. <var name="nullDocType" type="DocumentType" isNull="true"/>
  49. <var name="docElem" type="Element"/>
  50. <var name="rootNS" type="DOMString"/>
  51. <var name="rootName" type="DOMString"/>
  52. <load var="doc" href="hc_staff" willBeModified="false"/>
  53. <documentElement var="docElem" obj="doc"/>
  54. <namespaceURI var="rootNS" obj="docElem" interface="Node"/>
  55. <tagName var="rootName" obj="docElem"/>
  56. <implementation var="domImpl" obj="doc"/>
  57. <createDocument  var="newDoc" obj="domImpl" namespaceURI='rootNS' qualifiedName='rootName' doctype="nullDocType"/>
  58. <getElementsByTagName var="employeeList" obj="doc" tagname='"p"' interface="Document"/>
  59. <item var="elem1" obj="employeeList" index="0" interface="NodeList"/>
  60. <importNode var="elem2" obj="newDoc" importedNode="elem1" deep="false"/>
  61. <isEqualNode var="isEqual" obj="elem1" arg="elem2"/>
  62. <assertFalse  actual="isEqual"  id="nodeisequalnodeFalse11"/>
  63. <importNode var="elem3" obj="newDoc" importedNode="elem1" deep="true"/>
  64. <isEqualNode var="isEqual" obj="elem1" arg="elem3"/>
  65. <!--  if validating the nodes should be unequal
  66.          since the new node will not contain
  67.          default attributes.  Unable to make a statement
  68.          when not validating  -->
  69. <if><implementationAttribute name="validating" value="true"/>
  70. <assertFalse  actual="isEqual"  id="deepImportNoDTD"/>
  71. </if>
  72. <load var="dupDoc" href="hc_staff" willBeModified="true"/>
  73. <importNode var="elem4" obj="dupDoc" importedNode="elem1" deep="true"/>
  74. <isEqualNode var="isEqual" obj="elem1" arg="elem4"/>
  75. <assertTrue  actual="isEqual"  id="deepImportSameDTD"/>
  76. </test>
  77.