Changes for system-property()
Saxon 11.4 introduced changes to the results from
system-property(), following the fix for Bug #4962: SEF compiled with Saxon-EE returns system-property('xsl:product-name') as SAXON. From Saxon 11.4, to get compile-time results you must use a static expression; otherwise the evaluation is always deferred until run-time. e.g. using a static variable:
<xsl:variable name="prodVer" select="system-property('xsl:product-version')" static="yes"/>
Previously (with Saxon 11.3 and earlier), if the expression could be evaluated at compile-time (e.g. if this variable was not static), then it was, so compile-time information was returned. To get run-time information it was necessary to use an expression which was only evaluated at run-time. As explained in the documentation (https://www.saxonica.com/saxon-js/documentation2/index.html#!conformance/xslt30):
Generally, if the argument to fn:system-property() is a string literal, or a constant expression, then it is evaluated at compile time, and it gives information (such as the product version number) that applies to the product used when compiling the stylesheet. To get information about the run-time environment, supply an argument that can only be computed at run-time, or use a dynamic function call.
We need to update the SaxonJS documentation to explain this change, and update our tests, etc. which use
Furthermore, we should consider adding more (saxon namespace) properties to return compile-time infomation about the target processor and compiler. Currently we have
xsl:product-version: when XJ-compiling for JS, evaluated statically these return for instance
"JS 11.4". Note that
xsl:product-version is made up of the target edition and compiler version number; but we don't get the compiler edition (EE). The property
saxon:platform can also be used (with SaxonJS) to get run-time information about the platform ("Node.js" or "Browser").
Updated by Debbie Lockett 12 months ago
- Status changed from In Progress to Resolved
- Fix Committed on JS Branch 2, Trunk added
The documentation has been updated (specifically the details about
fn:system-property under conformance/xslt30).
Issue #5709 has been opened to follow up on adding new properties.
Please register to edit this issue