Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
135 views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...