Bug #4969
closedInvalid schema-aware SEF (Invalid alpha code)
100%
Description
Reported by email to support, with files available for download.
The failure occurs when loading a SEF file for a schema-aware stylesheet: it appears to contain a reference to an anonymous type whose name cannot be resolved.
Failure occurs in 10.5; it apparently worked in 9.9.1.8
Files
Updated by Michael Kay over 3 years ago
In the source XSLT, the variable declaration is:
<xsl:variable as="element(test:e)" name="e">
<xsl:copy-of select="$e" validation="strict" />
</xsl:variable>
Saxon has inferred a type for the variable of element(test:e, (anonymous type))
and is trying to save this inferred type in the SEF file. But anonymous types have no reliable persistent name; certainly not one that will survive export of the schema to an SCM file followed by reloading.
Short of some kind of scheme that links the SEF to a schema (with change control to protect against it changing), I think we should be dropping the anonymous type from exported representation.
Updated by Michael Kay over 3 years ago
I'm wondering if we could introduce some kind of notation so that instead of
as='1NE nQ{http://www.example.com/test}e cQ{http://ns.saxonica.com/anonymous-type}e_anonymous_type_1_at_line_5_of_test.xsd'
we output
as='1NE nQ{http://www.example.com/test}e c~'
where the ~
means "the schema type corresponding to the declared type of the global element declaration Q{http://www.example.com/test}e
".
But the simpler and safer fix is simply to drop the schema type from the alpha code if it's anonymous. It doesn't actually make a big difference: inferred type information is useful to the compiler, but it's not used very much (if at all) at run-time.
Updated by Michael Kay over 3 years ago
- File test.xsl test.xsl added
- File test.xml test.xml added
- File test.xsd test.xsd added
- File config_run.xml config_run.xml added
- File config_compile.xml config_compile.xml added
Uploading the data files for future reference as it's clearly "foo-bar" data with no sensitivity.
Updated by Michael Kay over 3 years ago
- Category set to Schema-Aware processing
- Status changed from New to In Progress
- Priority changed from Low to Normal
I've converted this to a JUnit test: s9apitests/TestXsltCompiler/testBug4969. It's working in 10.x but failing in 11.x for an unrelated reason:
Supplied static base URI is not a valid URI
at net.sf.saxon.trace.ExpressionPresenter.emitRetainedStaticContext(ExpressionPresenter.java:373)
caused by trying to export a stylesheet that has no known base URI. Fixed this to work like 10x - it will only fail when the static base URI is actually needed.
Updated by Michael Kay over 3 years ago
- Status changed from In Progress to Resolved
- Applies to branch 10, trunk added
- Fix Committed on Branch 10, trunk added
Fixed on the 10.x and 11.x branches. An anonymous schema type in the inferred content type of an element or attribute is no longer output to the SEF file.
Updated by O'Neil Delpratt about 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.6 added
Bug fix applied in the Saxon 10.6 maintenance release
Please register to edit this issue