How to know which version of XPATH and XSLT am I using...?
Say I have installed JDK 1.7 then which version of XPATH and XSLT do I have..?
How to know which version of XPATH and XSLT am I using...?
Say I have installed JDK 1.7 then which version of XPATH and XSLT do I have..?
Try
For example for me this prints
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.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.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.
Well if you use Java then you have a choice of XSLT and XPath processors. The one built-in in the JDK (I only know of 1.6 but I don't think it has changed in 1.7) is Apache Xalan which is an XSLT and XPath 1.0 processor. There however third party solutions like Saxon 9 which support XSLT and XPath 2.0. And there are certainly additional XQuery 1.0 implementations for Java, as XPath 2.0 is a subset of XQuery 1.0, you have further choices if you are interested in XPath 2.0.