Bug #5698
closedChanges for system-property()
100%
Description
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 system-property()
.
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-name
and xsl:product-version
: when XJ-compiling for JS, evaluated statically these return for instance "SAXON"
and "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").
Related issues
Updated by Debbie Lockett about 2 years ago
Changes committed on saxonjs2 and main branches, in tests and testdriver where system-property('xsl:product-version')
is used. i.e. to use a static variable where we really do want the compiler version information.
Updated by Debbie Lockett about 2 years ago
- Status changed from New to In Progress
TODO: update documentation.
The final proposal for new properties about compile-time info requires changes in the compilers, so should probably be opened separately as a Saxon feature issue.
Updated by Debbie Lockett about 2 years ago
- Related to Feature #5709: Compiler and target processor information from fn:system-property() added
Updated by Debbie Lockett about 2 years ago
- Related to Bug #4962: SEF compiled with Saxon-EE returns system-property('xsl:product-name') as SAXON added
Updated by Debbie Lockett about 2 years 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.
Updated by Norm Tovey-Walsh about 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in JS Release set to SaxonJS 2.5
Fixed in SaxonJS 2.5.
Please register to edit this issue
Also available in: Atom PDF Tracking page