Project

Profile

Help

Bug #5698

closed

Changes for system-property()

Added by Debbie Lockett over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
XSLT Conformance
Sprint/Milestone:
Start date:
2022-09-28
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2, Trunk
Fix Committed on JS Branch:
2, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

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

Related to Saxon - Feature #5709: Compiler and target processor information from fn:system-property()NewMichael Kay2022-10-04

Actions
Related to Saxon - Bug #4962: SEF compiled with Saxon-EE returns system-property('xsl:product-name') as SAXONClosedMichael Kay2021-04-05

Actions
Actions #1

Updated by Debbie Lockett over 1 year 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.

Actions #2

Updated by Debbie Lockett over 1 year 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.

Actions #3

Updated by Debbie Lockett over 1 year ago

  • Related to Feature #5709: Compiler and target processor information from fn:system-property() added
Actions #4

Updated by Debbie Lockett over 1 year ago

  • Related to Bug #4962: SEF compiled with Saxon-EE returns system-property('xsl:product-name') as SAXON added
Actions #5

Updated by Debbie Lockett over 1 year 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.

Actions #6

Updated by Norm Tovey-Walsh over 1 year 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