You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2010/05/05 17:45:22 UTC

svn commit: r941356 - /tomcat/trunk/webapps/docs/tomcat-docs.xsl

Author: kkolinko
Date: Wed May  5 15:45:21 2010
New Revision: 941356

URL: http://svn.apache.org/viewvc?rev=941356&view=rev
Log:
Replace spaces with underscore in HTML anchor names.
To preserve compatibility each (sub)section will now generate two anchors:
the old one and the new one, if they differ.
It is port of r936982 from tomcat/site

Modified:
    tomcat/trunk/webapps/docs/tomcat-docs.xsl

Modified: tomcat/trunk/webapps/docs/tomcat-docs.xsl
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/tomcat-docs.xsl?rev=941356&r1=941355&r2=941356&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/tomcat-docs.xsl (original)
+++ tomcat/trunk/webapps/docs/tomcat-docs.xsl Wed May  5 15:45:21 2010
@@ -189,11 +189,15 @@
     <xsl:variable name="name">
       <xsl:value-of select="@name"/>
     </xsl:variable>
+    <xsl:variable name="name2">
+      <xsl:value-of select="translate($name, ' ', '_')"/>
+    </xsl:variable>
     <table border="0" cellspacing="0" cellpadding="2">
       <!-- Section heading -->
       <tr><td bgcolor="{$banner-bg}">
           <font color="{$banner-fg}" face="arial,helvetica.sanserif">
-          <a name="{$name}">
+          <xsl:if test="$name != $name2"><a name="{$name}"><xsl:comment>()</xsl:comment></a></xsl:if>
+          <a name="{$name2}">
           <strong><xsl:value-of select="@name"/></strong></a></font>
         </td>
       <xsl:if test="@rtext">
@@ -226,11 +230,15 @@
       </xsl:if>
       <xsl:value-of select="@name"/>
     </xsl:variable>
+    <xsl:variable name="name2">
+      <xsl:value-of select="translate($name, ' ', '_')"/>
+    </xsl:variable>
     <table border="0" cellspacing="0" cellpadding="2">
       <!-- Subsection heading -->
       <tr><td bgcolor="{$sub-banner-bg}">
           <font color="{$sub-banner-fg}" face="arial,helvetica.sanserif">
-          <a name="{$name}">
+          <xsl:if test="$name != $name2"><a name="{$name}"><xsl:comment>()</xsl:comment></a></xsl:if>
+          <a name="{$name2}">
           <strong><xsl:value-of select="@name"/></strong></a></font>
       </td></tr>
       <!-- Subsection body -->
@@ -255,7 +263,10 @@
       </xsl:if>
       <xsl:value-of select="@name"/>
     </xsl:variable>
-    <li><a href="#{$name}"><xsl:value-of select="@name"/></a>
+    <xsl:variable name="name2">
+      <xsl:value-of select="translate($name, ' ', '_')"/>
+    </xsl:variable>
+    <li><a href="#{$name2}"><xsl:value-of select="@name"/></a>
     <xsl:if test="subsection">
       <ol><xsl:apply-templates mode="toc" select="subsection"/></ol>
     </xsl:if>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org