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="documentnormalizedocument10">
  20. <metadata>
  21. <title>documentnormalizedocument10</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.         Create an Element and a text node and verify the nodeValue of this text node and append these to
  28.         this Document.  If supported, invoke the setParameter method on this domconfiguration object to set the
  29.         "element-content-whitespace"  feature to false.  Invoke the normalizeDocument method and verify if
  30.         the text node has been discarded.
  31. </description>
  32. <contributor>Neil Delima</contributor>
  33. <date qualifier="created">2002-06-10</date>
  34. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-normalizeDocument"/>
  35. <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#parameter-element-content-whitespace"/>
  36. </metadata>
  37. <implementationAttribute name="namespaceAware" value="true"/>
  38. <var name="doc" type="Document"/>
  39. <var name="elem" type="Element"/>
  40. <var name="newText" type="Text"/>
  41. <var name="text" type="Text"/>
  42. <var name="nodeValue" type="DOMString"/>
  43. <var name="canSet" type="boolean"/>
  44. <var name="appendedChild" type="Node"/>
  45. <var name="domConfig" type="DOMConfiguration"/>
  46. <load var="doc" href="hc_staff" willBeModified="false"/>
  47. <createElement var="elem" obj="doc" tagName='"newElem"'/>
  48. <createTextNode var="newText" obj="doc" data='"Text    
  49.                      Node"'/>
  50. <appendChild obj="elem" var="appendedChild" newChild="newText"/>
  51. <appendChild obj="doc" var="appendedChild" newChild="elem"/>
  52. <firstChild var="text" obj="elem" interface="Node"/>
  53. <nodeValue var="nodeValue" obj="text"/>
  54. <assertEquals actual="nodeValue" expected='"Text        
  55.                      Node"' id="documentnormalizedocument10" ignoreCase="false"/>
  56. <domConfig obj="doc" var="domConfig" interface="Document"/>
  57. <canSetParameter var="canSet" obj="domConfig" name='"element-content-whitespace"' value="true"/>
  58. <assertTrue actual="canSet" id="canSetElementContentWhitespaceTrue"/>
  59. <setParameter obj="domConfig" name='"element-content-whitespace"'  value="true"/>
  60. <normalizeDocument obj="doc"/>
  61. <firstChild var="text" obj="elem" interface="Node"/>
  62. <nodeValue var="nodeValue" obj="text"/>
  63. <assertEquals actual="nodeValue" expected='"Text        
  64.                      Node"' id="documentnormalizedocument10_true1" ignoreCase="false"/>
  65. <canSetParameter var="canSet" obj="domConfig" name='"element-content-whitespace"' value="false"/>
  66. <if>
  67. <isTrue value="canSet"/>                     
  68. <setParameter obj="domConfig" name='"element-content-whitespace"' value="false"/>
  69. <normalizeDocument obj="doc"/>
  70. <firstChild var="text" obj="elem" interface="Node"/>
  71. <nodeValue var="nodeValue" obj="text"/>
  72. <assertEquals actual="nodeValue" expected='"Text Node"' id="documentnormalizedocument10_true2" ignoreCase="false"/>
  73. </if>
  74. </test>
  75.  
  76.