#373 Xslt2: normalize.xsl, error in named-template: tp:fixfileref

open
nobody
XSL (399)
5
2014-08-06
2007-01-30
Vito Piserchia
No

In common/normalize.xsl of the xslt2-stylesheet:

<xsl:template name="tp:fixfileref">
<xsl:element name="{local-name(.)}" namespace="{$docbook-namespace}">
<xsl:copy-of select="@*[name(.) != 'fileref' and name(.) != 'entityref']"/>

<xsl:choose>
<xsl:when test="@fileref">
<xsl:attribute name="fileref"
select="resolve-uri(@fileref, base-uri(.))"/>
</xsl:when>
<xsl:when test="@entityref">
<xsl:attribute name="fileref">
<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:element>
</xsl:template>

It lacks of an apply-templates (mode="#current") to
the children elements:

<xsl:template name="tp:fixfileref">
<xsl:element name="{local-name(.)}" namespace="{$docbook-namespace}">
<xsl:copy-of select="@*[name(.) != 'fileref' and name(.) != 'entityref']"/>

<xsl:choose>
<xsl:when test="@fileref">
<xsl:attribute name="fileref"
select="resolve-uri(@fileref, base-uri(.))"/>
</xsl:when>
<xsl:when test="@entityref">
<xsl:attribute name="fileref">
<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<!-- added -->
<xsl:apply-templates mode="m:fixnamespace"/>
</xsl:element>
</xsl:template>

Discussion