本文介绍了我使用的是哪个版本的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 ..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 06:43