How can i find which version of xpath is being supported in my browser ?
There are currently ver 1 and 2. 2 is way advanced.
You could check the user agent and versions (minor/major) and compare with a given supported list inside your client-side JavaScript code.
E.g. you could implement this list from Wikipedia.
I think the built-in XPath implementations in current desktop browsers like IE, Mozilla, Opera, Safari and Chrome are all XPath 1.0 implementations. If you want XPath 2.0 client-side then your best bet is to look at attempts to implement XQuery 1.0 (of which XPath 2.0 is a subset) in the browser, like http://www.xqib.org/.
At present the five major browsers only implement XPath 1.0.
If you want XPath 2.0 support you can either use Saxon CE (Saxon cross-compiled to Javascript that is working in all major browsers). or XQIB (XQuery in the browser).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With