diff options
author | Shaun McCance <shaunm@gnome.org> | 2010-08-05 16:18:37 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2010-08-05 16:18:37 -0400 |
commit | 362e38c41ed2576c6c8bbd0e036e30724f22d573 (patch) | |
tree | 4368906c8a2a2fb1a4dd815b3d6c509c783f33d7 /stylesheets | |
parent | 989d510a245d92d622e2659e736dce771a74aa31 (diff) | |
download | yelp-362e38c41ed2576c6c8bbd0e036e30724f22d573.tar.gz |
[db2html.xsl.in] Check chunk IDs when constructing xref URIs
I wasn't doing this before, because the doc transformations handle it just
fine, but it turns out it's useful to have more correct page ID information
in the URI before it ever goes to a YelpDocument.
Diffstat (limited to 'stylesheets')
-rw-r--r-- | stylesheets/db2html.xsl.in | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/stylesheets/db2html.xsl.in b/stylesheets/db2html.xsl.in index 4a2d48bc..5a87e22a 100644 --- a/stylesheets/db2html.xsl.in +++ b/stylesheets/db2html.xsl.in @@ -17,7 +17,24 @@ <!-- == db.xref.target == --> <xsl:template name="db.xref.target"> <xsl:param name="linkend"/> - <xsl:value-of select="concat('xref:', $linkend, '#', $linkend)"/> + <xsl:param name="target" select="key('idkey', $linkend)"/> + <xsl:param name="is_chunk" select="false()"/> + <xsl:choose> + <xsl:when test="$is_chunk"> + <xsl:value-of select="concat('xref:', $linkend)"/> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="target_chunk_id"> + <xsl:call-template name="db.chunk.chunk-id"> + <xsl:with-param name="node" select="$target"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="concat('xref:', $target_chunk_id)"/> + <xsl:if test="$target_chunk_id != $linkend"> + <xsl:value-of select="concat('#', $linkend)"/> + </xsl:if> + </xsl:otherwise> + </xsl:choose> </xsl:template> <!-- == db2html.division.head.extra == --> |