</xsl:choose>
</xsl:template>
+<xsl:template match="*" mode="xrefstyle">
+ <xsl:choose>
+ <xsl:when test="@role and not(@xrefstyle)
+ and $use.role.as.xrefstyle != 0">
+ <xsl:value-of select="@role"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@xrefstyle"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
</xsl:stylesheet>
<xsl:param name="olink.key" select="''"/>
<xsl:param name="referrer" select="."/>
<xsl:param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates select="." mode="xrefstyle"/>
</xsl:param>
<xsl:choose>
<xsl:param name="target.database"/>
<xsl:param name="linkend" select="''"/>
<xsl:param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates select="." mode="xrefstyle"/>
</xsl:param>
<xsl:variable name="targetdoc">
<xsl:param name="olink.lang" select="'en'"/>
<xsl:param name="target.database"/>
<xsl:param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates select="." mode="xrefstyle"/>
</xsl:param>
<xsl:variable name="page">
<xsl:param name="linkend" select="@linkend"/>
<xsl:param name="target" select="key('id', $linkend)"/>
<xsl:param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates select="." mode="xrefstyle"/>
</xsl:param>
<xsl:if test="not(starts-with(normalize-space($xrefstyle),'select:')
<xsl:variable name="targets" select="key('id',@linkend)|key('id',substring-after(@xlink:href,'#'))"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="refelem" select="local-name($target)"/>
+ <xsl:variable name="xrefstyle">
+ <xsl:apply-templates select="." mode="xrefstyle"/>
+ </xsl:variable>
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
a title. See bugs #1811721 and #1838136. -->
<xsl:when test="not(ancestor::*[@id = $target/@id] or ancestor::*[@xml:id = $target/@xml:id])">
- <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+ <xsl:apply-templates select="$target" mode="xref-to-prefix">
+ <xsl:with-param name="referrer" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:apply-templates>
<xsl:apply-templates select="$target" mode="xref-to">
-
<xsl:with-param name="referrer" select="."/>
- <xsl:with-param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
</xsl:apply-templates>
- <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+ <xsl:apply-templates select="$target" mode="xref-to-suffix">
+ <xsl:with-param name="referrer" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:param name="linkend.targets" select="key('id',@linkend)"/>
<xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
<xsl:param name="refelem" select="local-name($target)"/>
-
- <xsl:variable name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
+ <xsl:param name="xrefstyle">
+ <xsl:apply-templates select="." mode="xrefstyle"/>
+ </xsl:param>
<xsl:variable name="content">
<fo:inline xsl:use-attribute-sets="xref.properties">
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="refelem" select="local-name($target)"/>
+ <xsl:variable name="xrefstyle">
+ <xsl:apply-templates select="." mode="xrefstyle"/>
+ </xsl:variable>
+
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
<xsl:otherwise>
<xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+ <xsl:apply-templates select="$target" mode="xref-to-prefix">
+ <xsl:with-param name="referrer" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:apply-templates>
</xsl:if>
<fo:basic-link internal-destination="{@linkend}"
xsl:use-attribute-sets="xref.properties">
<xsl:apply-templates select="$target" mode="xref-to">
<xsl:with-param name="referrer" select="."/>
- <xsl:with-param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
</xsl:apply-templates>
</fo:basic-link>
<xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+ <xsl:apply-templates select="$target" mode="xref-to-suffix">
+ <xsl:with-param name="referrer" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="biblioentry|bibliomixed" mode="xref-to-prefix">
+ <xsl:param name="referrer"/>
+ <xsl:param name="xrefstyle"/>
<xsl:text>[</xsl:text>
</xsl:template>
<xsl:template match="biblioentry|bibliomixed" mode="xref-to-suffix">
+ <xsl:param name="referrer"/>
+ <xsl:param name="xrefstyle"/>
<xsl:text>]</xsl:text>
</xsl:template>
<xsl:param name="linkend" select="@linkend"/>
<xsl:param name="targets" select="key('id',$linkend)"/>
<xsl:param name="target" select="$targets[1]"/>
-
- <xsl:variable name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
+ <xsl:param name="xrefstyle">
+ <xsl:apply-templates select="." mode="xrefstyle"/>
+ </xsl:param>
<xsl:variable name="content">
<fo:inline xsl:use-attribute-sets="xref.properties">
<xsl:param name="linkend.targets" select="key('id',@linkend)"/>
<xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
- <xsl:variable name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
+ <xsl:param name="xrefstyle">
+ <xsl:apply-templates select="." mode="xrefstyle"/>
+ </xsl:param>
<xsl:call-template name="anchor"/>
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="refelem" select="local-name($target)"/>
+ <xsl:variable name="xrefstyle">
+ <xsl:apply-templates select="." mode="xrefstyle"/>
+ </xsl:variable>
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:variable>
<xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+ <xsl:apply-templates select="$target" mode="xref-to-prefix">
+ <xsl:with-param name="referrer" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:apply-templates>
</xsl:if>
<a href="{$href}">
</xsl:if>
<xsl:apply-templates select="$target" mode="xref-to">
<xsl:with-param name="referrer" select="."/>
- <xsl:with-param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
</xsl:apply-templates>
</a>
<xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+ <xsl:apply-templates select="$target" mode="xref-to-suffix">
+ <xsl:with-param name="referrer" select="."/>
+ <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+ </xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>