Fix template rules which use a variable reference in the value of the match
attribute. This is not allowed according to "5.3 Defining Template Rules" in REC-xslt-19991116, XSL Transformations (XSLT) Version 1.0. The xsltproc utility prior to version 1.1.15 allowed this erroneously but in the latest version it has been fixed. Reported by: scottl
This commit is contained in:
parent
04d7c71a69
commit
ce4b41cd27
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=25575
1 changed files with 47 additions and 40 deletions
|
@ -26,56 +26,63 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template match="*">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="@*" />
|
||||
<xsl:apply-templates />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="local-name() = $transtable-target-element">
|
||||
<xsl:element name="{local-name(.)}" namespace="{namespace-uri(.)}">
|
||||
<xsl:copy-of select="@*" />
|
||||
|
||||
<xsl:template match="*[local-name() = $transtable-target-element]">
|
||||
<xsl:element name="{local-name(.)}" namespace="{namespace-uri(.)}">
|
||||
<xsl:copy-of select="@*" />
|
||||
<xsl:call-template name="transtable-sortkey-lookup">
|
||||
<xsl:with-param name="word" select="." />
|
||||
<xsl:with-param name="word-group" select="$transtable-word-group" />
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="transtable-sortkey-lookup">
|
||||
<xsl:with-param name="word" select="." />
|
||||
<xsl:with-param name="word-group" select="$transtable-word-group" />
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name="transtable-lookup">
|
||||
<xsl:with-param name="word" select="." />
|
||||
<xsl:with-param name="word-group" select="$transtable-word-group" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:call-template name="transtable-lookup">
|
||||
<xsl:with-param name="word" select="." />
|
||||
<xsl:with-param name="word-group" select="$transtable-word-group" />
|
||||
</xsl:call-template>
|
||||
</xsl:element>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="@*" />
|
||||
<xsl:apply-templates />
|
||||
</xsl:copy>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- mode for generating sortkeytable -->
|
||||
|
||||
<xsl:template match="*" mode="sortkey">
|
||||
<xsl:apply-templates mode="sortkey"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="local-name() = $transtable-target-element">
|
||||
<xsl:element name="word">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:call-template name="transtable-lookup">
|
||||
<xsl:with-param name="word" select="." />
|
||||
<xsl:with-param name="word-group" select="$transtable-word-group" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="orig">
|
||||
<xsl:value-of select="." />
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="sortkey">
|
||||
<xsl:value-of select="'@sortkey@'" />
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:text disable-output-escaping="yes"> </xsl:text>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates mode="sortkey"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text()" mode="sortkey">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*[local-name() = $transtable-target-element]" mode="sortkey">
|
||||
<xsl:element name="word">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:call-template name="transtable-lookup">
|
||||
<xsl:with-param name="word" select="." />
|
||||
<xsl:with-param name="word-group" select="$transtable-word-group" />
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="orig">
|
||||
<xsl:value-of select="." />
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="sortkey">
|
||||
<xsl:value-of select="'@sortkey@'" />
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:text disable-output-escaping="yes"> </xsl:text>
|
||||
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in a new issue