dayvonjersen / ajaxslt

Automatically exported from code.google.com/p/ajaxslt
Other
0 stars 0 forks source link

Absolute XPath couldn't be resolved #34

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have the following HTML file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
   <script src="http://ajaxslt.googlecode.com/svn/tags/release-0-8-1/xmltoken.js"></script>
   <script src="http://ajaxslt.googlecode.com/svn/tags/release-0-8-1/util.js"></script>
   <script src="http://ajaxslt.googlecode.com/svn/tags/release-0-8-1/dom.js"></script>
   <script src="http://ajaxslt.googlecode.com/svn/tags/release-0-8-1/xpath.js"></script>
   <script>
       function tryMe() {
           var expr = xpathParse("/html/body/h1");
           var result = expr.evaluate(new ExprContext(document));
           var s = result.nodeSetValue();
           alert(s.length);
       }
       window.onload = tryMe;
   </script>
</head>
<body>
   <h1>Test</h1>
</body>
</html>

2. Open this file in your browser

What is the expected output? What do you see instead?

The expected output is '1', but 0 results are found using this XPath ("//h1" 
works just fine).

What version of the product are you using? On what operating system?

I'm using version 0.8.1.

Original issue reported on code.google.com by spek...@gmail.com on 29 May 2011 at 9:18