summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/4XPath/Borrowed/kd_20010423.html
blob: 6a80e2bfe5d49c5bf9fa8223c423cf3b5496949c (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
<!-- https://sourceforge.net/tracker/?func=detail&atid=106473&aid=418317&group_id=6473 -->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../js/resources/js-test-style.css">
<script src="../../../js/resources/js-test-pre.js"></script>
</head>
<body>
<div id="console"></div>

<script>
SRC_1 = '<?xml version="1.0" encoding="utf-8"?>\
<doc>\
<elem>abc</elem>\
<elem><![CDATA[abc]]></elem>\
<elem>a<![CDATA[b]]>c</elem>\
</doc>';

    doc = (new DOMParser).parseFromString(SRC_1, "application/xml");

    EXPR = '/doc/elem/text()'
    nodeset = doc.evaluate(EXPR, doc, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
    actual = "";
    while (currNode = nodeset.iterateNext())
        actual += currNode.nodeValue;
    
    // According to DOM XPath working group note, this should be "abcabca", but we'll rather match Firefox.
    // See <http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#TextNodes>.
    shouldBe('actual', '"abcabcabc"')

    var successfullyParsed = true;

</script>
<script src="../../../js/resources/js-test-post.js"></script>
</body>
</html>