summaryrefslogtreecommitdiffstats
path: root/docs/manual/style/latex
diff options
context:
space:
mode:
authorAndré Malo <nd@apache.org>2014-02-05 23:47:57 +0100
committerAndré Malo <nd@apache.org>2014-02-05 23:47:57 +0100
commit4d2c9470bc34443597ac926b181e429c03ea3533 (patch)
tree047bf9b8e1274414be3ece3aaee7f5ee863f8d38 /docs/manual/style/latex
parentupdate transformation (diff)
downloadapache2-4d2c9470bc34443597ac926b181e429c03ea3533.tar.xz
apache2-4d2c9470bc34443597ac926b181e429c03ea3533.zip
move string-reverse function into its own file and share it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/style/latex')
-rw-r--r--docs/manual/style/latex/html.xsl27
1 files changed, 3 insertions, 24 deletions
diff --git a/docs/manual/style/latex/html.xsl b/docs/manual/style/latex/html.xsl
index 108d470141..943db8b8b2 100644
--- a/docs/manual/style/latex/html.xsl
+++ b/docs/manual/style/latex/html.xsl
@@ -25,6 +25,9 @@
xmlns="http://www.w3.org/1999/xhtml">
+<!-- load utility snippets -->
+<xsl:include href="../xsl/util/string-reverse.xsl" />
+
<!-- ==================================================================== -->
<!-- Ordinary HTML that must be converted to latex -->
<!-- ==================================================================== -->
@@ -143,30 +146,6 @@
<xsl:text>}</xsl:text>
</xsl:template>
-<!-- O(log(n)) (stack usage!) string reverter -->
-<xsl:template name="string-reverse">
-<xsl:param name="string"/>
-<xsl:variable name="length" select="string-length($string)"/>
-
-<xsl:choose>
-<xsl:when test="$length &lt; 2">
- <xsl:value-of select="$string"/>
-</xsl:when>
-<xsl:when test="$length = 2">
- <xsl:value-of select="concat(substring($string, 2, 1), substring($string, 1, 1))"/>
-</xsl:when>
-<xsl:otherwise>
- <xsl:variable name="middle" select="floor($length div 2)"/>
-
- <xsl:call-template name="string-reverse">
- <xsl:with-param name="string" select="substring($string, $middle + 1, $middle + 1)"/>
- </xsl:call-template>
- <xsl:call-template name="string-reverse">
- <xsl:with-param name="string" select="substring($string, 1, $middle)"/>
- </xsl:call-template>
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
<!-- Value-of used here explicitly because we don't wan't latex-escaping
performed. Of course, this will conflict with html where some tags are