You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2003/01/11 12:18:11 UTC
cvs commit: xml-forrest/src/resources/skins/common/xslt/html document2html.xsl
jefft 2003/01/11 03:18:11
Modified: src/resources/skins/common/xslt/html document2html.xsl
Log:
If a section has an @id, use it in preference to the auto-generated id
Revision Changes Path
1.3 +21 -3 xml-forrest/src/resources/skins/common/xslt/html/document2html.xsl
Index: document2html.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/document2html.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- document2html.xsl 24 Dec 2002 02:04:22 -0000 1.2
+++ document2html.xsl 11 Jan 2003 11:18:11 -0000 1.3
@@ -96,14 +96,32 @@
<ul class="minitoc">
<xsl:for-each select="section">
<li>
- <a href="#{generate-id()}">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:if test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:if>
+ <xsl:if test="not(@id)">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:if>
+ </xsl:attribute>
<xsl:value-of select="title"/>
</a>
<xsl:if test="section">
<ul class="minitoc">
<xsl:for-each select="section">
<li>
- <a href="#{generate-id()}">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:if test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:if>
+ <xsl:if test="not(@id)">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:if>
+ </xsl:attribute>
<xsl:value-of select="title"/>
</a>
</li>