aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Yamin <plasmaroo@gentoo.org>2006-05-25 14:55:56 +0000
committerTim Yamin <plasmaroo@gentoo.org>2006-05-25 14:55:56 +0000
commit4ab28371b15098b671a0bf50a29c45c025e0db55 (patch)
tree4f14e9cab5583740fabea8add19a8fe0b14b8a41 /devbook.xsl
parentAdd AnonSVN linky. (diff)
downloaddevmanual-4ab28371b15098b671a0bf50a29c45c025e0db55.tar.gz
devmanual-4ab28371b15098b671a0bf50a29c45c025e0db55.tar.bz2
devmanual-4ab28371b15098b671a0bf50a29c45c025e0db55.zip
Fix // link fu.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/devmanual/trunk@57 176d3534-300d-0410-8db8-84e73ed771c3
Diffstat (limited to 'devbook.xsl')
-rw-r--r--devbook.xsl14
1 files changed, 10 insertions, 4 deletions
diff --git a/devbook.xsl b/devbook.xsl
index d4a7a1b..b95974e 100644
--- a/devbook.xsl
+++ b/devbook.xsl
@@ -299,22 +299,28 @@
<xsl:with-param name="data" select="substring-after(@link, '#')"/>
</xsl:call-template>
</xsl:variable>
+ <xsl:variable name="slash">
+ <xsl:if test="substring(substring-before(@link, '#'), string-length(substring-before(@link, '#'))) != '/'">/</xsl:if>
+ </xsl:variable>
<xsl:choose>
<xsl:when test=". != ''">
- <a href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '#'), '::'), '/index.html#', $anchor)}"><xsl:value-of select="."/></a>
+ <a href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '#'), '::'), $slash, 'index.html#', $anchor)}"><xsl:value-of select="."/></a>
</xsl:when>
<xsl:otherwise>
- <a href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '#'), '::'), '/index.html#', $anchor)}"><xsl:value-of select="substring-after(@link, '#')"/></a>
+ <a href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '#'), '::'), $slash, 'index.html#', $anchor)}"><xsl:value-of select="substring-after(@link, '#')"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
+ <xsl:variable name="slash">
+ <xsl:if test="substring(@link, string-length(@link)) != '/'">/</xsl:if>
+ </xsl:variable>
<xsl:choose>
<xsl:when test=". != ''">
- <a href="{concat($relative_path_depth_recursion, substring-after(@link, '::'), '/index.html')}"><xsl:value-of select="."/></a>
+ <a href="{concat($relative_path_depth_recursion, substring-after(@link, '::'), $slash, 'index.html')}"><xsl:value-of select="."/></a>
</xsl:when>
<xsl:otherwise>
- <a href="{concat($relative_path_depth_recursion, substring-after(@link, '::'), '/index.html')}"><xsl:value-of select="document(concat(/guide/@self, $relative_path_depth_recursion, substring-after(@link, '::'), '/text.xml'))/guide/chapter[1]/title"/></a>
+ <a href="{concat($relative_path_depth_recursion, substring-after(@link, '::'), $slash, 'index.html')}"><xsl:value-of select="document(concat(/guide/@self, $relative_path_depth_recursion, substring-after(@link, '::'), '/text.xml'))/guide/chapter[1]/title"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>