Author: kkolinko
Date: Thu Mar 4 09:49:04 2010
New Revision: 918916
URL: http://svn.apache.org/viewvc?rev=918916&view=rev
Log:
If subsection name is not unique, prefix the anchor name with the name of
section that contains it.
This is especially useful for the Tomcat configuration docs, where names such
as "Introduction" or "Attributes" are not unique. See e.g.
config/filter.html
config/valve.html
It is backport of r918914 from trunk
Modified:
tomcat/tc6.0.x/trunk/webapps/docs/tomcat-docs.xsl
Modified: tomcat/tc6.0.x/trunk/webapps/docs/tomcat-docs.xsl
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/tomcat-docs.xsl?rev=918916&r1=918915&r2=918916&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/tomcat-docs.xsl (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/tomcat-docs.xsl Thu Mar 4 09:49:04 2010
@@ -219,6 +219,11 @@
<!-- Process a documentation subsection -->
<xsl:template match="subsection">
<xsl:variable name="name">
+ <xsl:if test="
+ count(//*[(local-name()='section' or local-name()='subsection') and
@name=current()/@name]) > 1
+ ">
+ <xsl:value-of select="concat(ancestor::section/@name, '/')"/>
+ </xsl:if>
<xsl:value-of select="@name"/>
</xsl:variable>
<table border="0" cellspacing="0" cellpadding="2">
@@ -243,6 +248,11 @@
<xsl:template mode="toc" match="section|subsection">
<xsl:variable name="name">
+ <xsl:if test="local-name()='subsection' and
+ count(//*[(local-name()='section' or local-name()='subsection') and
@name=current()/@name]) > 1
+ ">
+ <xsl:value-of select="concat(ancestor::section/@name, '/')"/>
+ </xsl:if>
<xsl:value-of select="@name"/>
</xsl:variable>
<li><a href="#{$name}"><xsl:value-of select="@name"/></a>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]