<!-- * the following ID is used as part of the legalnotice filename; -->
<!-- * we need it in order to construct the filename for use in the -->
<!-- * value of the href attribute on the link -->
+
+<xsl:param name="ln-node" select="(//legalnotice)[1]"/>
+
<xsl:param name="id">
<xsl:call-template name="object.id">
- <xsl:with-param name="object" select="(//legalnotice)[1]"/>
+ <xsl:with-param name="object" select="$ln-node"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="linktype">
normalize-space(
substring-after($html.head.legalnotice.link.types, ' ')),' ')"/>
<xsl:if test="not($linktype = '')">
+
+ <!-- Use 'ln-' prefix if there is no @id/@xml:id -->
+ <xsl:variable name="file">
+ <xsl:choose>
+ <xsl:when test="$ln-node/@id or $ln-node/@xml:id">
+ <xsl:value-of select="concat($id,$html.ext)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<link rel="{$linktype}">
<xsl:attribute name="href">
- <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
+ <xsl:value-of select="$file"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:apply-templates select="(//legalnotice)[1]"
<xsl:template match="legalnotice" mode="titlepage.mode">
<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+ <!-- Use 'ln-' prefix if there is no @id/@xml:id -->
+ <xsl:variable name="file">
+ <xsl:choose>
+ <xsl:when test="@id or @xml:id">
+ <xsl:value-of select="concat($id,$html.ext)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:choose>
<xsl:when test="$generate.legalnotice.link != 0">
<xsl:variable name="filename">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir" select="$base.dir"/>
- <xsl:with-param name="base.name" select="concat('ln-',$id,$html.ext)"/>
+ <xsl:with-param name="base.name" select="$file"/>
</xsl:call-template>
</xsl:variable>
<xsl:apply-templates select="." mode="title.markup"/>
</xsl:variable>
- <a href="{concat('ln-',$id,$html.ext)}">
+ <a href="{$file}">
<xsl:copy-of select="$title"/>
</a>
<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+ <!-- Use 'rh-' prefix if there is no @id/@xml:id -->
+ <xsl:variable name="file">
+ <xsl:choose>
+ <xsl:when test="@id or @xml:id">
+ <xsl:value-of select="concat($id,$html.ext)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('rh-',$id,$html.ext)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:variable name="title">
<xsl:call-template name="gentext">
<xsl:with-param name="key">RevHistory</xsl:with-param>
<xsl:variable name="filename">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir" select="$base.dir"/>
- <xsl:with-param name="base.name" select="concat($id,$html.ext)"/>
+ <xsl:with-param name="base.name" select="$file"/>
</xsl:call-template>
</xsl:variable>
- <a href="{concat($id,$html.ext)}">
+ <a href="{$file}">
<xsl:copy-of select="$title"/>
</a>