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="nodecomparedocumentposition19">
  20. <metadata>
  21. <title>nodecomparedocumentposition19</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         The method compareDocumentPosition compares a node with this node with regard to their position in the
  25.         document and according to the document order.
  26.        
  27.         Using compareDocumentPosition check if the document position of the first CDATASection node
  28.         of the second element whose localName is name compared with the second CDATASection node
  29.         is PRECEDING and is FOLLOWING vice versa.
  30. </description>
  31. <contributor>Jenny Hsu</contributor>
  32. <date qualifier="created">2003-02-20</date>
  33. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-compareDocumentPosition"/>
  34. </metadata>
  35. <implementationAttribute name="coalescing" value="false"/>
  36. <implementationAttribute name="namespaceAware" value="true"/>
  37. <var name="doc" type="Document"/>
  38. <var name="elemList" type="NodeList"/>
  39. <var name="elemStrong" type="Element"/>
  40. <var name="cdata1" type="CDATASection"/>
  41. <var name="cdata2" type="CDATASection"/>
  42. <var name="aNode" type="Node"/>
  43. <var name="cdata1Position" type="int"/>
  44. <var name="cdata2Position" type="int"/>
  45. <load var="doc" href="hc_staff" willBeModified="false"/>
  46. <getElementsByTagNameNS var="elemList" obj="doc" namespaceURI='"*"' localName='"strong"' interface="Document"/>
  47. <item var="elemStrong" obj="elemList" index="1" interface="NodeList"/>
  48. <lastChild var="cdata2" obj="elemStrong" interface="Node"/>
  49. <previousSibling var="aNode" obj="cdata2" interface="Node"/>
  50. <previousSibling var="cdata1" obj="aNode" interface="Node"/>
  51. <compareDocumentPosition var="cdata1Position" obj="cdata1" other="cdata2"/>
  52. <assertEquals  actual="cdata1Position" expected="4" id="nodecomparedocumentposition19_cdata2Follows" ignoreCase="false"/>
  53. <compareDocumentPosition var="cdata2Position" obj="cdata2" other="cdata1"/>
  54. <assertEquals  actual="cdata2Position" expected="2" id="nodecomparedocumentposition_cdata1Precedes" ignoreCase="false"/>
  55. </test>
  56.