Bug #5024
closedXSLT 3 main module with expand-text="yes" sets that too for imported XSLT 2 module (which should retain its default expand-text="no")
100%
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:{".
Updated by Michael Kay over 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!
Updated by Debbie Lockett over 3 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.
Updated by Debbie Lockett over 3 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.
Updated by Debbie Lockett over 3 years ago
- Status changed from Resolved to Closed
Please register to edit this issue
Also available in: Atom PDF Tracking page