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..?
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.
XSLT uses XPath to find information in an XML document. XPath is used to navigate through elements and attributes in XML documents. In the transformation process, XSLT uses XPath to define parts of the source document that should match one or more predefined templates.
XPath. At bottom, XSLT is a language that lets you specify what sorts of things to do when a particular element is encountered. But to write a program for different parts of an XML data structure, you need to specify the part of the structure you are talking about at any given time. XPath is that specification language ...
Extensible Stylesheet Language: Transformations (XSLT) is a language for transforming the structure of XML documents. It is designed for use as part of Extensible Stylesheet Language (XSL). XML Path Language (XPath) is an XSL sub-language that is designed to be used with XSLT.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With