|
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="documentnormalizedocument03"> |
|
20 <metadata> |
|
21 <title>documentnormalizedocument03</title> |
|
22 <creator>IBM</creator> |
|
23 <description> |
|
24 Normalize a document with a created CDATA section with the |
|
25 'cdata-sections' parameter set to true then to false and check if |
|
26 the CDATASection has been preserved and then coalesced. |
|
27 </description> |
|
28 <contributor>Neil Delima</contributor> |
|
29 <date qualifier="created">2002-06-10</date> |
|
30 <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-normalizeDocument"/> |
|
31 <subject resource="http://www.w3.org/Bugs/Public/show_bug.cgi?id=416"/> |
|
32 <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#parameter-cdata-sections"/> |
|
33 </metadata> |
|
34 <implementationAttribute name="namespaceAware" value="true"/> |
|
35 <var name="doc" type="Document"/> |
|
36 <var name="elem" type="Element"/> |
|
37 <var name="newCdata" type="CDATASection"/> |
|
38 <var name="cdata" type="CDATASection"/> |
|
39 <var name="text" type="Node"/> |
|
40 <var name="nodeName" type="DOMString"/> |
|
41 <var name="nodeValue" type="DOMString"/> |
|
42 <var name="appendedChild" type="Node"/> |
|
43 <var name="domConfig" type="DOMConfiguration"/> |
|
44 <var name="pList" type="NodeList"/> |
|
45 <var name="errorMonitor" type="DOMErrorMonitor"/> |
|
46 <load var="doc" href="barfoo" willBeModified="true"/> |
|
47 <getElementsByTagName var="pList" obj="doc" tagname='"p"' interface="Document"/> |
|
48 <item var="elem" obj="pList" index="0" interface="NodeList"/> |
|
49 <createCDATASection var="newCdata" obj="doc" data='"CDATA"'/> |
|
50 <appendChild obj="elem" var="appendedChild" newChild="newCdata"/> |
|
51 <domConfig obj="doc" var="domConfig" interface="Document"/> |
|
52 <setParameter obj="domConfig" name='"cdata-sections"' value="true"/> |
|
53 <setParameter obj="domConfig" name='"error-handler"' value="errorMonitor"/> |
|
54 <normalizeDocument obj="doc"/> |
|
55 <assertLowerSeverity obj="errorMonitor" severity="SEVERITY_ERROR" id="normalizationError"/> |
|
56 <getElementsByTagName var="pList" obj="doc" tagname='"p"' interface="Document"/> |
|
57 <item var="elem" obj="pList" index="0" interface="NodeList"/> |
|
58 <lastChild var="cdata" obj="elem" interface="Node"/> |
|
59 <nodeName var="nodeName" obj="cdata"/> |
|
60 <assertEquals actual="nodeName" expected='"#cdata-section"' id="documentnormalizedocument03_true" ignoreCase="false"/> |
|
61 <setParameter obj="domConfig" name='"cdata-sections"' value="false"/> |
|
62 <normalizeDocument obj="doc"/> |
|
63 <assertLowerSeverity obj="errorMonitor" severity="SEVERITY_ERROR" id="normalization2Error"/> |
|
64 <getElementsByTagName var="pList" obj="doc" tagname='"p"' interface="Document"/> |
|
65 <item var="elem" obj="pList" index="0" interface="NodeList"/> |
|
66 <lastChild var="text" obj="elem" interface="Node"/> |
|
67 <nodeName var="nodeName" obj="text"/> |
|
68 <assertEquals actual="nodeName" expected='"#text"' id="documentnormalizedocument03_false" ignoreCase="false"/> |
|
69 <nodeValue var="nodeValue" obj="text"/> |
|
70 <assertEquals actual="nodeValue" expected='"barCDATA"' id="normalizedValue" ignoreCase="false"/> |
|
71 </test> |
|
72 |