n5ken / xpathchecker

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

XPath checker doesnt work with xpath functions.(Solution code attached) #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Assume that the xpath expression //td[@id='testid'] returns "helloworld".
Suppose I want to use a Xpath function, say substring it doesnt work.

like,

substring(//td[@id='testid'],2,5) doesnt display "ellow"

This is because the function "getXPathNodes" is coded to always expect a set of 
nodes from the "document.evaluate" function. But the "document.evaluate" 
function may also return a string, number or a boolean data type, which is the 
case in the example above.

I modified the code and it is working fine. Attaching the file window.js with 
the changes. I modified the following two functions for this :

-- getXPathNodes
-- search 

~
arunav
p.s. this tool was a great timesaver for me ... thanks !!!

Original issue reported on code.google.com by arunav...@gmail.com on 25 Jul 2010 at 9:02

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch! I've uploaded a new version (with some small changes). It 
should be available for download as soon as someone at Mozilla reviews it.

Original comment by bslesinsky on 26 Jul 2010 at 1:20