哪些浏览器支持 Xpath 2.0? [英] What browsers support Xpath 2.0?

查看:40
本文介绍了哪些浏览器支持 Xpath 2.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在使用 XPath,并且一直在寻找有关哪些浏览器支持 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.

这清楚地告诉我 Firefox 和 IE(两者的所有版本)都不支持 XPath 2.0,但是 Chrome、Safari 等的其他渲染引擎呢?有没有人有这方面的信息或知道在哪里可以找到它?

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?

推荐答案

我不知道有什么,官方实现列表也不包含一个.

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

另一种选择——当然比原生实现的性能低——是 XQIB,它是 JavaScript 中的 XQuery 实现.XPath 2.0 作为 XQuery 1.0 的子集完全包含在内,因此您将能够在所有支持 JavaScript 的浏览器中使用所有 XPath 2.0 特性(以及更多特性).

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>

这篇关于哪些浏览器支持 Xpath 2.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆