blob: 5c5c9253830f3496ba97d6668b0a3e1c2642f624 [file] [log] [blame]
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11815">bug 11815</a>:
XPathEvaluator behavior does not match Firefox - substring() and empty element.</p>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var strXML = '<data><record></record><record>-hi-</record></data>';
var doc = (new DOMParser()).parseFromString(strXML, "text/xml");
var xpe = new XPathEvaluator();
var objResult = xpe.evaluate("//record[substring(.,1,1)='-']", doc, null, 0, null);
var itm = null;
var objNodes = [];
while (itm = objResult.iterateNext()) objNodes.push(itm);
if (objNodes.length == 1)
document.write("SUCCESS");
else
document.write("FAILURE: matched " + objNodes.length + " nodes.");
</script>