Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xpath support in my browser?

Tags:

browser

xpath

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.

like image 258
Royi Namir Avatar asked Oct 16 '11 11:10

Royi Namir


3 Answers

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.

like image 121
Uwe Keim Avatar answered Oct 01 '22 01:10

Uwe Keim


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/.

like image 26
Martin Honnen Avatar answered Oct 01 '22 00:10

Martin Honnen


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).

like image 28
Dimitre Novatchev Avatar answered Oct 01 '22 01:10

Dimitre Novatchev