Bug #5556
open
element-available('xsl:import-schema') returns true for Saxon-HE, and when compiling for SaxonJS
0%
Description
Saxon-HE is non-schema-aware, so I'd expect element-available('xsl:import-schema')
to return false, however it returns true.
Updated by Debbie Lockett 24 days ago
I discovered this bug investigating the failure of XSLT 3.0 test suite test catalog-006b in SaxonJS. The test fails there because element-available('xsl:import-schema')
correctly returns false for non-schema-aware SaxonJS; but the tests catalog-006 and catalog-006b expect that "all XSLT element names in non-error stylesheets satisfy element-available()". So these test should actually have a dependency on the "schema_aware" feature.
Updated by Debbie Lockett 24 days ago
- Subject changed from element-available('xsl:import-schema') returns true for Saxon-HE to element-available('xsl:import-schema') returns true for Saxon-HE, and when compiling for SaxonJS
When exporting to SEF for use with SaxonJS (using -target:JS
), the compile-time evaluation of element-available('xsl:import-schema')
also returns true. Though the SaxonJS documentation (https://www.saxonica.com/saxon-js/documentation2/index.html#!starting/export/compiling-using-XJ) says that:
compile-time evaluation of functions such as system-property(), function-available(), element-available() considers the target environment, not the compiler environment.
Updated by Debbie Lockett 24 days ago
Moreover, when compiling for SaxonJS, if a stylesheet uses xsl:import-schema, we should throw a XTSE1650 error at compile time. (Currently when exporting to SEF with Saxon-EE 10 and 11, there is no error, such a stylesheet seems to be exported OK; but the SEF then contains a "schema" reference, which is ignored by SaxonJS, and so can lead to unexpected results.)
Please register to edit this issue