You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2004/01/03 22:45:03 UTC
cvs commit: httpd-2.0/docs/manual/style/chm hhp.xsl
nd 2004/01/03 13:45:03
Modified: docs/manual/style/chm hhp.xsl
Log:
single char replacement can be done with translate()
Revision Changes Path
1.4 +18 -41 httpd-2.0/docs/manual/style/chm/hhp.xsl
Index: hhp.xsl
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/chm/hhp.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- hhp.xsl 1 Jan 2004 13:20:07 -0000 1.3
+++ hhp.xsl 3 Jan 2004 21:45:03 -0000 1.4
@@ -186,24 +186,24 @@
<!-- files referenced in sitemap -->
<!-- ==================================================================== -->
<xsl:template match="category/page">
-<xsl:call-template name="helper.back-slash">
- <xsl:with-param name="file">
- <xsl:choose>
- <xsl:when test="contains(@href, '#') and substring(@href,
- string-length(substring-before(@href, '#')), 1) = '/'">
- <xsl:value-of select="substring-before(@href, '#')" />
- <xsl:text>index.html</xsl:text>
- </xsl:when>
- <xsl:when test="substring(@href, string-length(@href), 1) = '/'">
- <xsl:value-of select="@href"/>
- <xsl:text>index.html</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@href"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
-</xsl:call-template>&lf;
+<xsl:variable name="filename">
+ <xsl:choose>
+ <xsl:when test="contains(@href, '#') and substring(@href,
+ string-length(substring-before(@href, '#')), 1) = '/'">
+ <xsl:value-of select="substring-before(@href, '#')" />
+ <xsl:text>index.html</xsl:text>
+ </xsl:when>
+ <xsl:when test="substring(@href, string-length(@href), 1) = '/'">
+ <xsl:value-of select="@href"/>
+ <xsl:text>index.html</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@href"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+
+<xsl:value-of select="translate($filename, '/', '\')" />&lf;
</xsl:template>
<!-- /page[@href] -->
@@ -217,29 +217,6 @@
<xsl:text>.html</xsl:text>&lf;
</xsl:template>
<!-- /modulefilelist/modulefile -->
-
-
-<!-- ==================================================================== -->
-<!-- turn slashes back -->
-<!-- ==================================================================== -->
-<xsl:template name="helper.back-slash">
-<xsl:param name="file" />
-
-<xsl:choose>
-<xsl:when test="contains($file, '/')">
- <xsl:value-of select="substring-before($file, '/')" />
- <xsl:text>\</xsl:text>
-
- <xsl:call-template name="helper.back-slash">
- <xsl:with-param name="file" select="substring-after($file, '/')" />
- </xsl:call-template>
-</xsl:when>
-<xsl:otherwise>
- <xsl:value-of select="$file" />
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-<!-- /helper.back-slash -->
<!-- ==================================================================== -->