4 1 10 90 9 9 9 === these tests fail : how do I advance step by step? 0 0 0 === failed to obtain text() 0
ns:p[2]/ns:table[2]/ns:tbody/ns:tr/ns:td/ns:table/ns:tbody/ns:tr/ns:td[1]/ns:a/ns:font/text()",
ns.prefixed("ns"))
Hi Richard,
This is a basic tenet of xpaths, they are always namespace aware. Which leaves changing the parsing itself.
Alas I have also not been able to configure Nu.validator to turn this off. Perhaps using JTagSoup or other similar libraries will be a better fit. You can include them as Loaners in the same way.
Cheers,
Chris
I will put a branch out tomorrow to demonstrate what I mean. However I'll not break XPath usage by default, especially not given my previous experience of doing that.
If you are using a document without explicit namespaces you won't need prefixes. This is also detailed on the lxml site for example.
Nu.validator adds a namespace and forces a standards compliant library (such as Jaxen) to need that namespace (or test via the local-name function), which is what you are seeing. (according to their docs this would seem to be a bug that you can't turn it off)
Currently on the master branch is a tagsoup loaner*, which allows for non namespaced html parsing. The xpaths work just the tbody elements don't exist.
* it required an abstraction over reading sax properties, so it isn't compatible with RC 7, but will be in the final.