XML :: LibXML实现了什么版本的XPath? [英] What version of XPath is implemented in XML::LibXML?

查看:112
本文介绍了XML :: LibXML实现了什么版本的XPath?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道XML :: LibMXL已实现哪个版本的XPath规范吗?

Does anybody know which version of the XPath specification has been implemented in XML::LibMXL?

或者更重要的是,在哪里可以找到我可以在LibXML中使用的XPath函数的描述?

Or more to the point, where can I find a description of the XPath functions that I can use in LibXML?

例如,我尝试了类似的方法

For example, I tried something like

$dcDOM->findvalue('//dc:identifier[contains(@xsi:type,"URI")]');

看起来不错,但是

$dcDOM->findvalue('//dc:identifier[matches(@xsi:type,"URI")]');

没有.

因此,必须假定它最多支持XPath 1.0或1.0/2.0的某些子集.

From that one has to assume that it supports at most XPath 1.0 or some subset of 1.0/2.0 .

是否有一个整齐的页面,列出并描述了所有内容?

Is there a neat page where everything is listed and described?

推荐答案

从您的探查中推测出来,XML :: LibXML支持XPath 1.0(不是2.0).

As you surmised from your probe, XML::LibXML supports XPath 1.0 (not 2.0).

通常来说,除了通过此类探测之外,XPath本身无法确定版本.另一方面,XSLT提供system-property('xsl:version')来标识版本信息.

Generally speaking, there is no way in XPath itself to ascertain the version other than through such probes. XSLT, on the other hand, provides system-property('xsl:version') for identifying version information.

遵循源遗产路线:XML :: LibXML 基于放在libxml2上,该实现 XPath 1.0,如Libxml2主页上所述:

Going the source heritage route: XML::LibXML is based on libxml2, which implements XPath 1.0, as stated right on the Libxml2 homepage:

Libxml2实现了许多与标记相关的现有标准 语言:

Libxml2 implements a number of existing standards related to markup languages:

     XML Path Language (XPath) 1.0: http://www.w3.org/TR/xpath

您可能会问为什么libxml2不支持XPath 2.0?或阅读维护者Daniel Veillard的旧帖子,其中说: XPath 2.0规范太大而不能打扰",但底线仍然是: XML :: LibXML支持XPath 1.0,而不是2.0.

You might ask Why doesn't libxml2 support XPath 2.0? or read an old post from maintainer Daniel Veillard that says that XPath 2.0 spec is "far too big and intrusive," but the bottom line remains: XML::LibXML supports XPath 1.0, not 2.0.

这篇关于XML :: LibXML实现了什么版本的XPath?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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