I am trying this XPath query but it returns an empty enumeration. Is someone familiar with this problem? Other XPath queries on AJAX loaded XMLs work fine. document is XHTML1.1 I am suspecting xhtml namespace (xmlns="http://www.w3.org/1999/xhtml")
Always display 0.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table id="tbl">
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
<tr><td>7</td><td>8</td><td>9</td></tr>
</table>
</body>
<script>
//ORIGINAL: var result = document.evaluate('table#tbl/tr/td[3]/text()', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
var result = document.evaluate('//body', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
var node;
var c = 0;
while (node = result.iterateNext()) c++;
alert(c); // Always 0??? Why?
</script>
</html>