fn-substring.html (601B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://www.w3.org/TR/1999/REC-xpath-19991116/#function-substring"> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="helpers.js"></script> 6 <body> 7 <div id="context"></div> 8 <script> 9 test(() => { 10 const context = document.querySelector('#context'); 11 context.innerHTML = '<span>^^^bar$$$</span><span></span><br><br><br><br>'; 12 assert_equals(evaluateString('substring((./span)[1], count(./br))', context), 'bar$$$'); 13 }, 'substring() arguments depending on the context node'); 14 </script> 15 </body>