Project

Profile

Help

Bug #5024

closed

XSLT 3 main module with expand-text="yes" sets that too for imported XSLT 2 module (which should retain its default expand-text="no")

Added by Martin Honnen almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2021-06-15
Due date:
% Done:

100%

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

Description

See https://saxonica.plan.io/boards/5/topics/8212?r=8213#message-8213, when an XSLT 3 main stylesheet module with expand-text="yes" imports or includes another module which has an implicit default expand-text="no", the code in the included/imported module using curly braces in text nodes results in an "Error Q{http://www.w3.org/2005/xqt-errors}XTSE0350 at XSLT-value-template.xsl#55 Missing closing brace after expression:{".

Actions #1

Updated by Michael Kay almost 3 years ago

I suspect, subject to testing, that the solution is along the following lines.

At static.xsl line 164 we do

<xsl:variable name="stylesheet-properties" as="attribute()*"
            select="
                @default-mode, @expand-text,
                if (exists($parent-version) and $version ne $parent-version) then
                    @version
                else
                    ()"/>

If there is no @expand-text attribute we should add the attribute expand-text="no" to this list. This is probably best done by turning the expression into XSLT:

<xsl:variable name="stylesheet-properties" as="attribute()*">
  <xsl:sequence select="@default-mode, @expand-text"/>
  <xsl:if test="empty(@expand-text)">
    <xsl:attribute name="expand-text" select="'no'"/>
  </xsl:if>
  <xsl:if test="exists($parent-version) and $version ne $parent-version">
    <xsl:sequence select="@version"/>
  </xsl:if>
</xsl:variable>

A use-case for the proposed new-attribute() function to construct attributes within XPath!

Actions #2

Updated by Debbie Lockett over 2 years ago

  • Status changed from New to Resolved
  • Fix Committed on JS Branch 2 added

Test -s:expand-text -t:cvt-048 added to the XSLT3 test suite. This demonstrates the problem: the test fails for Saxon-JS 2.2 with XX compilation, but passes with XJ compilation.

Fix committed in XXcompiler static.xsl stylesheet as suggested above.

Actions #3

Updated by Debbie Lockett over 2 years ago

  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 2.3

Bug fix applied in the Saxon-JS 2.3 maintenance release.

Actions #4

Updated by Debbie Lockett over 2 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF Tracking page