Bug #5563


SaxonJS allows elements in supposedly empty xsl:copy-of instruction

Added by Martin Honnen about 2 years ago. Updated almost 2 years ago.

XSLT Conformance
Start date:
Due date:
% Done:


Estimated time:
Applies to JS Branch:
2, Trunk
Fix Committed on JS Branch:
2, Trunk
Fixed in JS Release:
SEF Generated with:
Contact person:
Additional contact persons:


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.

Actions #1

Updated by John Lumley about 2 years 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.

Actions #2

Updated by Norm Tovey-Walsh about 2 years ago

  • Priority changed from Low to High
  • Sprint/Milestone changed from SaxonJS 2.4 to SaxonJS 3.0
Actions #3

Updated by Michael Kay about 2 years ago

Added XSLT3 test cases copy-0104 and copy-0105.

Actions #4

Updated by Michael Kay about 2 years ago

XSLT-elements.xsl line 81 reads

        <copy-of select="expression" copy-namespaces="boolean" copy-accumulators="boolean" type="eqname" validation="strict|lax|preserve|strip">

The <sequence-constructor/> is incorrect.

Actions #5

Updated by Debbie Lockett about 2 years ago

  • Status changed from New to Resolved
  • Priority changed from High to Normal
  • Sprint/Milestone deleted (SaxonJS 3.0)
  • 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.)

Actions #6

Updated by Norm Tovey-Walsh almost 2 years ago

  • Sprint/Milestone set to SaxonJS 2.5
Actions #7

Updated by Norm Tovey-Walsh almost 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to SaxonJS 2.5

Fixed in SaxonJS 2.5.

Please register to edit this issue

Also available in: Atom PDF Tracking page