Author: kkolinko Date: Thu Mar 4 09:47:35 2010 New Revision: 918914 URL: http://svn.apache.org/viewvc?rev=918914&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
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=918914&r1=918913&r2=918914&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/tomcat-docs.xsl (original) +++ tomcat/trunk/webapps/docs/tomcat-docs.xsl Thu Mar 4 09:47:35 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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org