Project

Profile

Help

Bug #2681

closed

System properties: early evaluation

Added by Michael Kay over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT export
Sprint/Milestone:
Start date:
2016-03-21
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7, trunk
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:

Description

The argument to the XSLT system-property() function is generally written as a string literal, and Saxon will generally evaluate the function during stylesheet compilation, which allows optimization based on the result (for example, code within the test "if (system-property('xsl:vendor') eq 'Microsoft')..." will be eliminated at compile time).

This strategy is wrong in cases where the stylesheet is exported, and is then executed in a different environment. A stylesheet that is being exported is necessarily compiled under Saxon-EE, where system properties such as xsl:is-schema-aware and xsl:supports-higher-order-functions will take the value "yes"; but the exported stylesheet may be evaluated in an environment where schema-awareness and higher-order-functions are not supported. Evaluation in these cases should therefore be deferred until run-time.

Note that there's nothing much we can do about calls that appear within static expressions, e.g. use-when. These are necessarily evaluated at compile time.

Please register to edit this issue

Also available in: Atom PDF