summaryrefslogtreecommitdiff
path: root/test/testcases/tests/level1/core/cdatasectionnormalize.xml
blob: ce654f6ae2688c0a7ce15342060c3c4427a137b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2001 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All
Rights Reserved. This program is distributed under the W3C's Software
Intellectual Property License. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
See W3C License http://www.w3.org/Consortium/Legal/ for more details.
--><!DOCTYPE test SYSTEM "dom1.dtd">

<test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-1" name="cdatasectionnormalize">
<metadata>
<title>cdataSectionNormalize</title>
<creator>NIST</creator>
<description>
Adjacent CDATASection nodes cannot be merged together by
use of the "normalize()" method from the Element interface.
Retrieve second child of the second employee and invoke
the "normalize()" method.  The Element under contains
two CDATASection nodes that should not be merged together
by the "normalize()" method.
</description>
<contributor>Mary Brady</contributor>
<date qualifier="created">2001-08-17</date>
<subject resource="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083"/>
</metadata>
<var name="doc" type="Document"/>
<var name="nameList" type="NodeList"/>
<var name="lChild" type="Element"/>
<var name="childNodes" type="NodeList"/>
<var name="cdataN" type="CDATASection"/>
<var name="data" type="DOMString"/>
<load var="doc" href="staff" willBeModified="true"/>
<getElementsByTagName interface="Document" obj="doc" var="nameList" tagname="&quot;name&quot;"/>
<item interface="NodeList" obj="nameList" var="lChild" index="1"/>
<normalize obj="lChild"/>
<childNodes obj="lChild" var="childNodes"/>
<item interface="NodeList" obj="childNodes" var="cdataN" index="1"/>
<assertNotNull actual="cdataN" id="firstCDATASection"/>
<data interface="CharacterData" obj="cdataN" var="data"/>
<assertEquals actual="data" expected='"This is a CDATASection with EntityReference number 2 &amp;ent2;"' ignoreCase="false" id="data1"/>
<item interface="NodeList" obj="childNodes" var="cdataN" index="3"/>
<assertNotNull actual="cdataN" id="secondCDATASection"/>
<data interface="CharacterData" obj="cdataN" var="data"/>
<assertEquals actual="data" expected='"This is an adjacent CDATASection with a reference to a tab &amp;tab;"' ignoreCase="false" id="data3"/>
</test>