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="documentnormalizedocument09">
  20. <metadata>
  21. <title>documentnormalizedocument09</title>
  22. <creator>IBM</creator>
  23. <description>
  24.         The normalizeDocument method method acts as if the document was going through a save
  25.         and load cycle, putting the document in a "normal" form.
  26.  
  27.         Set the validate-if-schema feature to true.  Invoke the normalizeDocument method on this
  28.         document.  Retreive the documentElement node and check the nodeName of this node
  29.         to make sure it has not changed.  Now set validate to false and verify the same.
  30.         Register an error handler on this Document and in each case make sure that it does
  31.         not get called.
  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#Document3-normalizeDocument"/>
  36. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#parameter-validate-if-schema"/>
  37. </metadata>
  38. <implementationAttribute name="namespaceAware" value="true"/>
  39. <var name="doc" type="Document"/>
  40. <var name="docElem" type="Element"/>
  41. <var name="docElemNodeName" type="DOMString"/>
  42. <var name="canSet" type="boolean"/>
  43. <var name="errorHandler" type="DOMErrorHandler"/>
  44. <var name="errHandler" type="DOMErrorHandler">
  45.         <handleError>
  46.                 <assertFalse actual="true" id="documentnormalizedocument09_Err"/>
  47.                 <return value="true"/>
  48.         </handleError>
  49. </var>
  50. <var name="domConfig" type="DOMConfiguration"/>
  51. <load var="doc" href="hc_staff" willBeModified="false"/>
  52. <domConfig obj="doc" var="domConfig" interface="Document"/>
  53. <setParameter obj="domConfig" name='"error-handler"' value="errHandler"/>
  54. <canSetParameter var="canSet" obj="domConfig" name='"validate-if-schema"' value="true"/>
  55. <if>
  56. <isTrue value="canSet"/>
  57. <setParameter obj="domConfig" name='"validate-if-schema"' value="true"/>
  58. <normalizeDocument obj="doc"/>
  59. <documentElement var="docElem" obj="doc"/>
  60. <nodeName var="docElemNodeName" obj="docElem"/>
  61. <assertEquals actual="docElemNodeName" expected='"html"' id="documentnormalizedocument09_True" ignoreCase="false"/>
  62. </if>
  63. <setParameter obj="domConfig" name='"validate-if-schema"' value="false"/>
  64. <normalizeDocument obj="doc"/>
  65. <documentElement var="docElem" obj="doc"/>
  66. <nodeName var="docElemNodeName" obj="docElem"/>
  67. <assertEquals actual="docElemNodeName" expected='"html"' id="documentnormalizedocument09_False" ignoreCase="false"/>
  68. </test>
  69.  
  70.  
  71.