javaxsltapache-fopjava-13

xsl version 2.0 in JDK 13?


I'm trying to use XSL Version 2.0 with openJDK 13 & apache FOP.

Despite having coded the following in the Stylesheet:

<xsl:stylesheet version="2.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">

...

<xsl:value-of select="system-property('xsl:version')"/>

...is returning "1.0"

How can I get XSL Version 2.0 running in this environment?


Solution

  • The usual way in the Java environment to have XSLT 2 or these days XSLT 3 support is to put Saxon 9 or Saxon 10 HE on the class path. Saxon HE is available on SourceForge or Maven. I think the releases 9.8, 9.9 and 10 all target Java 8 but should run as well with later Java JREs and JDKs as these maintain backwards compatibility.