Project

Profile

Help

Bug #5563

closed

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

Added by Martin Honnen about 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2022-06-14
Due date:
% Done:

0%

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

Description

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 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.

Actions #2

Updated by Norm Tovey-Walsh about 2 months 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 months ago

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

Actions #4

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>

The <sequence-constructor/> is incorrect.

Actions #5

Updated by Debbie Lockett about 2 months 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.)

Please register to edit this issue

Also available in: Atom PDF Tracking page