SaxonJS allows elements in supposedly empty xsl:copy-of instruction
Due to some mental mistake I wrote some XSLT code using e.g.
<xsl:copy-of select="."><xsl:apply-templates/></xsl:copy-of> and SaxonJS let met get away with it. When moving my code to SaxonJ, I found that it doesn't allow it and gives an error that
xsl:copy-of is supposed to be empty, as indeed the XSLT spec defines it.
So I suppose this is a bug in terms of XSLT comformance of SaxonJS.
Updated by John Lumley about 2 months ago
Yes - this looks like an oversight - the original 'syntax check' for
xsl:copy-of incorrectly declared the possibility of a sequence constructor child (as
xsl:copy of course is permitted, and I assume I copy-and-pasted). Interestingly there must have been no XSLT test case which checked for a compiler error in such circumstances. The runtime code appears to ignore any children however.
Updated by Michael Kay about 2 months ago
XSLT-elements.xsl line 81 reads
<copy-of select="expression" copy-namespaces="boolean" copy-accumulators="boolean" type="eqname" validation="strict|lax|preserve|strip"> <sequence-constructor/> </copy-of>
<sequence-constructor/> is incorrect.
Updated by Debbie Lockett about 2 months ago
- Status changed from New to Resolved
- Priority changed from High to Normal
- Sprint/Milestone deleted (
- Applies to JS Branch Trunk added
- Fix Committed on JS Branch 2, Trunk added
Fix committed in XSLT-elements.xsl. (And this fix is sufficient now that bug #5555 has been resolved to regenerate XSLT-schema.xsl in the build.)
Please register to edit this issue