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"?>
  2.  
  3. <!--
  4.  
  5. Copyright (c) 2003 Oracle
  6.  
  7. All Rights Reserved.  This program is distributed under the W3C's
  8. Software Intellectual Property License [1].  This program is distributed
  9. in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  10. even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE.
  12.  
  13. [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  14.  
  15. -->
  16. <!DOCTYPE test SYSTEM "dom3.dtd">
  17. <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="canReplaceChildTrue">
  18. <metadata>
  19.  
  20. <title>canReplaceChildTrue</title>
  21. <creator>Kongyi Zhou</creator>
  22. <description>
  23.    The method canReplaceChild checks with schema to see if new child 'editor' can replace
  24.    old child 'author'
  25.    should return VAL_TRUE  
  26. </description>
  27. <contributor>Oracle Corp.</contributor>
  28. <date qualifier="created">2003-03-01</date>
  29. <subject resource="http://www.w3.org/TR/2003/CR-DOM-Level-3-Val-20030730/validation#VAL-Interfaces-NodeEditVAL-canReplaceChild"/>
  30. </metadata>
  31. <implementationAttribute name="schemaValidating" value="true"/>
  32.  
  33. <var name="doc" type="Document"/>
  34. <var name="root" type="ElementEditVAL"/>
  35. <var name="valboolean" type="short"/>
  36. <var name="oldchild" type="Node"/>
  37. <var name="nlist" type="NodeList"/>
  38. <var name="newchild" type="Element"/>
  39. <var name="nullNS" type="DOMString" isNull="true"/>
  40. <load var="doc" href="book" willBeModified="false"/>
  41. <getElementsByTagName interface="Document" obj="doc" tagname='"author"' var="nlist"/>
  42. <item obj="nlist" index="0" var="oldchild" interface="NodeList"/>
  43. <documentElement obj="doc"  var="root"/>
  44. <createElementNS obj="doc" namespaceURI="nullNS" qualifiedName='"editor"' var="newchild"/>
  45. <canReplaceChild obj="root" newChild="newchild" oldChild="oldchild" var="valboolean"/>
  46. <assertEquals actual="valboolean" expected="5" ignoreCase="false" id="canReplaceChildTrue"/>
  47. </test>