summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/4XPath/Borrowed/sr_20021217.html
blob: 207c3ab070e710b3125211d88cf09594433b86af (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
<!-- http://lists.fourthought.com/pipermail/4suite/2002-December/004771.html -->
<!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>
    DOC1 = '<a><b><c/><d/></b></a>'

    doc = (new DOMParser).parseFromString(DOC1, "application/xml");
    nodeset = doc.evaluate('.//*', doc.documentElement, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
    node_names = "";
    while (currNode = nodeset.iterateNext())
        node_names += currNode.nodeName;
    shouldBe('node_names', '"bcd"')

    nodeset = doc.evaluate('(.//*)[1]', doc.documentElement, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
    node_names = "";
    while (currNode = nodeset.iterateNext())
        node_names += currNode.nodeName;
    shouldBe('node_names', '"b"')

    var successfullyParsed = true;

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