Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which version of XPATH and XSLT am I using..?

Tags:

java

xslt

xpath

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..?

like image 584
John Avatar asked Oct 31 '11 09:10

John


People also ask

How do I know my XSLT version?

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.

Does XSLT use XPath?

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.

What is the difference between XPath and XSLT?

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 ...

What is XSL XSLT and XPath?

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.


1 Answers

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.

like image 71
Michael Kay Avatar answered Sep 17 '22 15:09

Michael Kay