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="documentadoptnode16">
  20. <metadata>
  21. <title>documentadoptnode16</title>
  22. <creator>IBM</creator>
  23. <description>
  24. Create a document fragment with an entity reference, adopt the node and check
  25. that the entity reference value comes from the adopting documents DTD.
  26. </description>
  27. <contributor>Neil Delima</contributor>
  28. <date qualifier="created">2002-06-10</date>
  29. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-adoptNode"/>
  30. </metadata>
  31. <var name="doc" type="Document"/>
  32. <var name="docFragment" type="DocumentFragment"/>
  33. <var name="childList" type="NodeList"/>
  34. <var name="parent" type="Element"/>
  35. <var name="child" type="Element"/>
  36. <var name="childsAttr" type="Attr"/>
  37. <var name="entRef" type="EntityReference"/>
  38. <var name="textNode" type="Text"/>
  39. <var name="adopted" type="Node"/>
  40. <var name="parentImp" type="Element"/>
  41. <var name="childImp" type="Element"/>
  42. <var name="attributes" type="NamedNodeMap"/>
  43. <var name="childAttrImp" type="Attr"/>
  44. <var name="nodeValue" type="DOMString"/>
  45. <var name="appendedChild" type="Node"/>
  46. <var name="attrNode" type="Attr"/>
  47. <var name="firstChild" type="Node"/>
  48. <var name="firstChildType" type="int"/>
  49. <var name="firstChildName" type="DOMString"/>
  50. <var name="firstChildValue" type="DOMString"/>
  51. <load var="doc" href="hc_staff" willBeModified="true"/>
  52. <createDocumentFragment var="docFragment" obj="doc"/>
  53. <createElement var="parent" obj="doc" tagName='"parent"'/>
  54. <createElement var="child" obj="doc" tagName='"child"'/>
  55. <createAttribute var="childsAttr" obj="doc" name='"state"'/>
  56. <createEntityReference var="entRef" obj="doc" name='"gamma"'/>
  57. <createTextNode var="textNode" obj="doc" data='"Test"'/>
  58. <appendChild obj="childsAttr" var="appendedChild" newChild="entRef"/>
  59. <setAttributeNode obj="child" var="attrNode" newAttr="childsAttr"/>
  60. <appendChild obj="child" var="appendedChild" newChild="textNode"/>
  61. <appendChild obj="parent" var="appendedChild" newChild="child"/>
  62. <appendChild obj="docFragment" var="appendedChild" newChild="parent"/>
  63. <adoptNode  var="adopted" obj="doc" source="docFragment"/>
  64. <if><notNull obj="adopted"/>
  65. <firstChild var="parentImp" obj="adopted" interface="Node"/>
  66. <firstChild var="childImp" obj="parentImp" interface="Node"/>
  67. <attributes var="attributes" obj="childImp"/>
  68. <getNamedItem var="childAttrImp" obj="attributes" name='"state"'/>
  69. <firstChild var="firstChild" obj="childAttrImp" interface="Node"/>
  70. <assertNotNull actual="firstChild" id="firstChildNotNull"/>
  71. <nodeName var="firstChildName" obj="firstChild"/>
  72. <nodeValue var="firstChildValue" obj="firstChild"/>
  73. <nodeType var="firstChildType" obj="firstChild"/>
  74. <if>
  75.         <!--  if first child of the attribute is an
  76.                 entity, then it should be for ent3  -->
  77.         <equals actual="firstChildType" expected="5"/>
  78.         <assertEquals actual="firstChildName" expected='"gamma"'
  79.                 ignoreCase="false" id="firstChildEnt3Ref"/>
  80.         <else>
  81.                 <!--  otherwise the value should be expanded as Texas  -->
  82.                 <assertEquals expected='"Texas"' actual="firstChildValue"
  83.                         id="documentadoptnode16"
  84.                         ignoreCase="false"/>
  85.         </else>
  86. </if>
  87. </if>
  88. </test>
  89.