[library-web] xslt: update <term> handling to allow for @id (GNOME bug 674704)



commit 5e96513616bae9acfff77590adeb7d7e679e71dc
Author: FrÃdÃric PÃters <fpeters 0d be>
Date:   Sun Aug 12 20:55:33 2012 +0200

    xslt: update <term> handling to allow for @id (GNOME bug 674704)

 data/xslt/db2html.xsl |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/data/xslt/db2html.xsl b/data/xslt/db2html.xsl
index b0b635b..3c83e71 100644
--- a/data/xslt/db2html.xsl
+++ b/data/xslt/db2html.xsl
@@ -507,4 +507,39 @@ span.label { display: none; }
   </html>
 </xsl:template>
 
+<xsl:template match="term">
+  <dt>
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="../@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="../@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
+    <xsl:attribute name="class">
+      <xsl:text>term</xsl:text>
+      <xsl:if test="not(../preceding-sibling::varlistentry)">
+        <xsl:text> dt-first</xsl:text>
+      </xsl:if>
+    </xsl:attribute>
+    <!-- compared to the original xslt this condition is changed,
+         from ../varlistentry/@id to ../@id -->
+    <xsl:if test="../@id and not(preceding-sibling::term)">
+      <xsl:call-template name="db2html.anchor">
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </dt>
+</xsl:template>
+
 </xsl:stylesheet>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]