Project

Profile

Help

Bug #5556

open

element-available('xsl:import-schema') returns true for Saxon-HE, and when compiling for SaxonJS

Added by Debbie Lockett 24 days ago. Updated 24 days ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2022-06-09
Due date:
% Done:

0%

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

Description

Saxon-HE is non-schema-aware, so I'd expect element-available('xsl:import-schema') to return false, however it returns true.

Actions #1

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.

Actions #2

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.

Actions #3

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

Also available in: Atom PDF