Home | History | Annotate | Download | only in Borrowed
      1 <!-- https://sourceforge.net/tracker/?func=detail&atid=106473&aid=418317&group_id=6473 -->
      2 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
      3 <html>
      4 <head>
      5 <link rel="stylesheet" href="../../../js/resources/js-test-style.css">
      6 <script src="../../../js/resources/js-test-pre.js"></script>
      7 </head>
      8 <body>
      9 <div id="console"></div>
     10 
     11 <script>
     12 SRC_1 = '<?xml version="1.0" encoding="utf-8"?>\
     13 <doc>\
     14 <elem>abc</elem>\
     15 <elem><![CDATA[abc]]></elem>\
     16 <elem>a<![CDATA[b]]>c</elem>\
     17 </doc>';
     18 
     19     doc = (new DOMParser).parseFromString(SRC_1, "application/xml");
     20 
     21     EXPR = '/doc/elem/text()'
     22     nodeset = doc.evaluate(EXPR, doc, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
     23     actual = "";
     24     while (currNode = nodeset.iterateNext())
     25         actual += currNode.nodeValue;
     26     
     27     // According to DOM XPath working group note, this should be "abcabca", but we'll rather match Firefox.
     28     // See <http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#TextNodes>.
     29     shouldBe('actual', '"abcabcabc"')
     30 
     31     var successfullyParsed = true;
     32 
     33 </script>
     34 <script src="../../../js/resources/js-test-post.js"></script>
     35 </body>
     36 </html>
     37