I\'m looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn\'t find one. Have you seen any?
I think you can use Cameron McCormack's xpath library here. It's perfectly working for me.
Google has just released Wicked Good XPath - A rewrite of Cybozu Lab's famous JavaScript-XPath.
Link: https://github.com/google/wicked-good-xpath
The rewritten version is 40% smaller and about 30% faster than the original implementation.
You could make use of the existing native DOM support of each browser. For this you would have to create your own wrapper, the reason is the differences between browser. You can take a look at http://dotnetcaffe.blogspot.com
Best regards
The other option could be LlamaLab XPath.js (though seems to be a bit old)
You may want to try jQuery XPath plugin with support for XPath 2.0 syntax that works cross-browser.
I don't think it allows for ad-hoc queries, but you might take a look at Johann Burkard's XSLT jQuery plug-in for inspiration on how to implement XPath queries. I use it in my jQuery Reference Dashboard widget and it's really solid.