]> granicus.if.org Git - apache/commitdiff
single char replacement can be done with translate()
authorAndré Malo <nd@apache.org>
Sat, 3 Jan 2004 21:45:03 +0000 (21:45 +0000)
committerAndré Malo <nd@apache.org>
Sat, 3 Jan 2004 21:45:03 +0000 (21:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102168 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/chm/hhp.xsl

index 3165726cdea6d73191c6b1ac3348c3b3037e2e18..dd3c3c93bf7450397269a7fd638284e67885f821 100644 (file)
 <!-- 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] -->
 
 <!-- /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 -->
-
-
 <!-- ==================================================================== -->
 <!-- convert number to its hexadecimal representation.                    -->
 <!-- I could not find a built-in function, so write our own ... *sigh*    -->