我使用的是哪个版本的 XPATH 和 XSLT? [英] Which version of XPATH and XSLT am I using..?

查看:22
本文介绍了我使用的是哪个版本的 XPATH 和 XSLT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道我使用的是哪个版本的 XPATH 和 XSLT...?

How to know which version of XPATH and XSLT am I using...?

假设我已经安装了 JDK 1.7 那么我有哪个版本的 XPATH 和 XSLT..?

Say I have installed JDK 1.7 then which version of XPATH and XSLT do I have..?

推荐答案

在 XSLT 中,调用 system-property('xsl:version').它将返回 1.0 或 2.0,具体取决于您使用的是 1.0 还是 2.0 处理器.

In XSLT, call system-property('xsl:version'). It will return 1.0 or 2.0 depending on whether you are using a 1.0 or 2.0 processor.

在 XPath 中,没有直接的等价物.但是一个快速的测试是不带参数调用 current-date() .如果成功,您将拥有 2.0 处理器,如果失败,您将拥有 1.0 处理器.

In XPath, there's no direct equivalent. But a quick test is to call current-date() with no arguments. If this succeeds, you have a 2.0 processor, if it fails, you have a 1.0 processor.

除非您采取措施在类路径或认可库中安装 2.0 处理器(例如 Saxon),否则 JDK 提供给您的 XSLT 处理器(今天)将是 1.0 处理器.

Unless you take steps to install a 2.0 processor such as Saxon on your class path or in the endorsed library, the XSLT processor that the JDK gives you will (today) be a 1.0 processor.

这篇关于我使用的是哪个版本的 XPATH 和 XSLT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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