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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…