I have noticed that BaseX xslt:processor() and xslt:version() returns incorrect info when used with Saxon 9.1B
It appears to identify it as a Saxon processor, and assumes it’s Saxon HE and version 3.0 .
This is different from what the XSLT system-property function returns.
( I’m using Saxon9B because I have stylesheets based on that version that use external java functions.
I’m going to be updating these to use BaseX XQuery functions to pass params into the stylesheet instead of those external functions internal to the stylesheets, and I was hoping I could use those xslt:processor() function to keep track of which Saxon library was active as I was migrating the stylesheets. Setting CLASSPATH on the command line works OK for that use case, but I’m working on RESTXQ web apps, so I need to keep track of config when web app was started. )
Xq/processor.xq:
version="1.0" >
<xsl:output method="text" />
<xsl:template match="/" >
<xsl:value-of select="system-property( 'xsl:vendor' )" />,
<xsl:value-of select="system-property( 'xsl:vendor-url' )" />
XSLT Version=<xsl:value-of select="system-property( 'xsl:version' )" />
</xsl:template>
</xsl:stylesheet>
return (xslt:transform-text( <null/>, $XS ), concat('(', xslt:processor(), ', Version:', xslt:version(), ')') )
$ CLASSPATH=$SAXON91B basex Xq/processor.xq
SAXON 9.1.0.8 from Saxonica,
http://www.saxonica.com/XSLT Version=2.0
(Saxon HE, Version:3.0)
I think it would be better to make XQuery xslt functions return the same values as XSLT system-property function.
However, I would understand why you might not want to make an incompatible and slower change to current behavior, especially for a rather rare use case.
If you keep the current behavior, I suggest a documentation note about how the function determines that value and that it may not be accurate in all circumstances.
I can obviously write my own function as above to get correct values.
( I know I mostly only write to this list when I have a problem or find an issue, however this *really* is a very solid implementation. Thank You! )
— Steve Majewski