trunk/resources/tests/dom3/Core/documentnormalizedocument12.xml
changeset 0 5057afe1ec87
equal deleted inserted replaced
-1:000000000000 0:5057afe1ec87
       
     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 
       
    19 <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="documentnormalizedocument12">
       
    20 <metadata>
       
    21 <title>documentnormalizedocument12</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 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"/>
       
    37 </metadata>
       
    38 <implementationAttribute name="validating" value="true"/>
       
    39 <implementationAttribute name="schemaValidating" value="true"/>
       
    40 <implementationAttribute name="namespaceAware" value="true"/>
       
    41 <var name="doc" type="Document"/>
       
    42 <var name="docElem" type="Element"/>
       
    43 <var name="docElemNodeName" type="DOMString"/>
       
    44 <var name="canSet" type="boolean"/>
       
    45 <var name="domConfig" type="DOMConfiguration"/>
       
    46 <var name="errorHandler" type="DOMErrorHandler"/>
       
    47 <var name="errHandler" type="DOMErrorHandler">
       
    48 	<handleError>
       
    49 		<assertFalse actual="true" id="documentnormalizedocument08_Err"/>
       
    50 		<return value="true"/>
       
    51 	</handleError>
       
    52 </var>
       
    53 <load var="doc" href="hc_staff" willBeModified="false"/>
       
    54 <domConfig obj="doc" var="domConfig" interface="Document"/>
       
    55 <setParameter obj="domConfig" name='"error-handler"' value="errHandler"/>
       
    56 <canSetParameter var="canSet" obj="domConfig" name='"validate"' value="true"/>
       
    57 <if>
       
    58 <isTrue value="canSet"/>
       
    59 <setParameter obj="domConfig" name='"validate"' value="true"/>
       
    60 <normalizeDocument obj="doc"/>
       
    61 <documentElement var="docElem" obj="doc"/>
       
    62 <nodeName var="docElemNodeName" obj="docElem"/>
       
    63 <assertEquals actual="docElemNodeName" expected='"html"' id="documentnormalizedocument08_True" ignoreCase="false"/>
       
    64 </if>
       
    65 <setParameter obj="domConfig" name='"validate"' value="false"/>
       
    66 <normalizeDocument obj="doc"/>
       
    67 <documentElement var="docElem" obj="doc"/>
       
    68 <nodeName var="docElemNodeName" obj="docElem"/>
       
    69 <assertEquals actual="docElemNodeName" expected='"html"' id="documentnormalizedocument08_False" ignoreCase="false"/>
       
    70 </test> 
       
    71  
       
    72