forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: rev 53944 - forrest/trunk/src/core/context/resources/stylesheets
Date Thu, 07 Oct 2004 06:17:31 GMT
Author: crossley
Date: Wed Oct  6 23:17:30 2004
New Revision: 53944

Modified:
   forrest/trunk/src/core/context/resources/stylesheets/docbook2document.xsl
Log:
Add support for xreflabel to the xref template.
This enables an author to provide a link value whose string is custom
and does not appear in the document.
Submitted by: Sean Wheller sean<AT>inwords.co.za
Issue: FOR-309


Modified: forrest/trunk/src/core/context/resources/stylesheets/docbook2document.xsl
==============================================================================
--- forrest/trunk/src/core/context/resources/stylesheets/docbook2document.xsl	(original)
+++ forrest/trunk/src/core/context/resources/stylesheets/docbook2document.xsl	Wed Oct  6 23:17:30
2004
@@ -721,6 +721,7 @@
                   </xsl:choose>
             </tt>
       </xsl:template>
+    
     <xsl:template match="xref">
         <xsl:param name="linkend">
             <xsl:value-of select="@linkend"/>
@@ -728,6 +729,9 @@
         <xsl:param name="endterm">
             <xsl:value-of select="@endterm"/>
         </xsl:param>
+        <xsl:param name="xreflabelvalue">
+            <xsl:value-of select="@xreflabel"/>
+        </xsl:param>
         <xsl:param name="linkendvalue">
             <xsl:if test="$linkend">
                 <xsl:value-of select="//*[@id=$linkend]/title"/>
@@ -745,7 +749,14 @@
                         <xsl:text>#</xsl:text>
                         <xsl:value-of select="$linkend"/>
                     </xsl:attribute>
-                    <xsl:value-of select="$linkendvalue"/>
+                    <xsl:choose>
+                        <xsl:when test="@xreflabel">
+                            <xsl:value-of select="$xreflabelvalue"/>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:value-of select="$linkendvalue"/>
+                        </xsl:otherwise>
+                    </xsl:choose>
                 </xsl:element>
                 <xsl:apply-templates/>
             </xsl:when>

Mime
View raw message