Bug #2681
closedSystem properties: early evaluation
100%
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