forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iss...@cocoondev.org
Subject [JIRA] Created: (FOR-308) docbook2document xref support
Date Mon, 04 Oct 2004 22:03:58 GMT
Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-308

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-308
    Summary: docbook2document xref support
       Type: Improvement

     Status: Unassigned
   Priority: Minor

    Project: Forrest
 Components: 
             Core operations
   Versions:
             HEAD

   Assignee: 
   Reporter: Sean Wheller

    Created: Mon, 4 Oct 2004 5:03 PM
    Updated: Mon, 4 Oct 2004 5:03 PM

Description:
docbook2document was unable to support the docbook xref element.

This patch adds xref support.

Index: docbook2document.xsl
===================================================================
--- docbook2document.xsl	(revision 53728)
+++ docbook2document.xsl	(working copy)
@@ -707,9 +707,44 @@
                   </xsl:choose>
             </tt>
       </xsl:template>
+    <xsl:template match="xref">
+        <xsl:param name="linkend">
+            <xsl:value-of select="@linkend"/>
+        </xsl:param>
+        <xsl:param name="endterm">
+            <xsl:value-of select="@endterm"/>
+        </xsl:param>
+        <xsl:param name="linkendvalue">
+            <xsl:if test="$linkend">
+                <xsl:value-of select="//*[@id=$linkend]/title"/>
+            </xsl:if>
+        </xsl:param>
+        <xsl:param name="endtermvalue">
+            <xsl:if test="$endterm">
+                <xsl:value-of select="//*[@id=$endterm]"/>
+            </xsl:if>
+        </xsl:param>
+        <xsl:choose>
+            <xsl:when test="//xref[not(@endterm)]">
+                <xsl:element name="a">
+                    <xsl:attribute name="href">
+                        <xsl:value-of select="$linkend"/>
+                    </xsl:attribute>
+                    <xsl:value-of select="$linkendvalue"/>
+                </xsl:element>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:element name="a">
+                    <xsl:attribute name="href">
+                        <xsl:value-of select="$linkend"/>
+                    </xsl:attribute>
+                    <xsl:value-of select="$endtermvalue"/>
+                </xsl:element>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
 
 
-
       <xsl:template match="node()|@*" priority="-1">
             <xsl:copy>
                   <xsl:apply-templates select="node()|@*"/>



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message