Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What browsers support Xpath 2.0?

I have recently been working with XPath and have been searching for information on which browsers support XPath 2.0 without much luck. The best I could find was the query technologies comparison table of various rendering engines.

This clearly tells me that Firefox and IE (all versions of both) do not support XPath 2.0, but what about the other rendering engines for Chrome, Safari, etc.? Does anybody have any information on this or know where one can find it?

like image 308
Default Avatar asked May 20 '13 21:05

Default


People also ask

Does browser engine support XPath 2.0 functions like ends with?

XPath 2.0 is fully included as a subset in XQuery 1.0, so you will be able to use all XPath 2.0 features (and more) in all browsers with JavaScript support. Show activity on this post. Majority of the browsers do not support XPATH 2.0, please see Comparison of layout engines to get more information.

Does Firefox support XPath?

Firefox currently supports XPath 1.0.

What is XPath version?

XPath 2.0 is a version of the XPath language defined by the World Wide Web Consortium, W3C. It became a recommendation on 23 January 2007. As a W3C Recommendation it was superseded by XPath 3.0 on 10 April 2014. XPath is used primarily for selecting parts of an XML document.

Which browser supports XSLT?

Web browsers: Safari, Chrome, Firefox, Opera and Internet Explorer all support XSLT 1.0 (only). Browsers can perform on-the-fly transformations of XML files and display the transformation output in the browser window.


2 Answers

I do not know of any, and the official list of implementations doesn't include one either.

An alternative - of course less performant than a native implementation - would be XQIB which is an XQuery implementation in JavaScript. XPath 2.0 is fully included as a subset in XQuery 1.0, so you will be able to use all XPath 2.0 features (and more) in all browsers with JavaScript support.

A short sample taken from their website on how to use it:

<script type="text/javascript" src="mxqueryjs/mxqueryjs.nocache.js"></script> <script type="application/xquery">   b:alert(     let $x := <a><b>2</b><c>4</c></a>     return xs:string($x/b * $x/c)   ) </script> 
like image 101
Jens Erat Avatar answered Sep 18 '22 09:09

Jens Erat


Majority of the browsers do not support XPATH 2.0, please see Comparison of layout engines to get more information.

However you may get support of the XPATH 2.0 in Firefox by using Saxon-CE, see more on the MDN XSLT_2.0 page.

like image 24
Andriy Ivaneyko Avatar answered Sep 19 '22 09:09

Andriy Ivaneyko