]> granicus.if.org Git - docbook-dsssl/commitdiff
Tweaked bibliography formatting to include the labels
authorNorman Walsh <ndw@nwalsh.com>
Fri, 12 Oct 2001 18:12:35 +0000 (18:12 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 12 Oct 2001 18:12:35 +0000 (18:12 +0000)
xsl/html/biblio.xsl

index 4be40be638a195c0546dd2cd9585e2bd539ba97c..0b14d2862479c0a264bae32642c46de69f4d704e 100644 (file)
@@ -86,6 +86,7 @@
           <div class="{name(.)}">
             <xsl:call-template name="anchor"/>
             <p>
+              <xsl:call-template name="biblioentry.label"/>
               <xsl:text>Error: no bibliography entry: </xsl:text>
               <xsl:value-of select="$id"/>
               <xsl:text> found in </xsl:text>
       <div class="{name(.)}">
         <xsl:call-template name="anchor"/>
         <p>
+          <xsl:call-template name="biblioentry.label"/>
           <xsl:apply-templates mode="bibliography.mode"/>
         </p>
       </div>
             <xsl:text> found in </xsl:text>
             <xsl:value-of select="$bibliography.collection"/>
           </xsl:message>
-          <div id="{$id}" class="{name(.)}">
+          <div class="{name(.)}">
             <xsl:call-template name="anchor"/>
             <p>
+              <xsl:call-template name="biblioentry.label"/>
               <xsl:text>Error: no bibliography entry: </xsl:text>
               <xsl:value-of select="$id"/>
               <xsl:text> found in </xsl:text>
       </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
-      <div id="{$id}" class="{name(.)}">
+      <div class="{name(.)}">
         <xsl:call-template name="anchor"/>
-        <p>
-          <xsl:choose>
-            <xsl:when test="local-name(*[1]) = 'abbrev'">
-              <xsl:apply-templates select="*[position()&gt;1]|text()"
-                                   mode="bibliomixed.mode"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:apply-templates mode="bibliomixed.mode"/>
-            </xsl:otherwise>
-          </xsl:choose>
+        <p class="{name(.)}">
+          <xsl:call-template name="biblioentry.label"/>
+          <xsl:apply-templates mode="bibliomixed.mode"/>
         </p>
       </div>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
+<xsl:template name="biblioentry.label">
+  <xsl:param name="node" select="."/>
+
+  <xsl:text>[</xsl:text>
+  <xsl:choose>
+    <xsl:when test="local-name($node/child::*[1]) = 'abbrev'">
+      <xsl:apply-templates select="$node/abbrev[1]"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$node/@id"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:text>] </xsl:text>
+</xsl:template>
+
 <!-- ==================================================================== -->
 
 <xsl:template match="*" mode="bibliography.mode">
 </xsl:template>
 
 <xsl:template match="abbrev" mode="bibliography.mode">
-  <span class="{name(.)}">
-    <xsl:text>[</xsl:text>
+  <xsl:if test="preceding-sibling::*">
     <xsl:apply-templates mode="bibliography.mode"/>
-    <xsl:text>] </xsl:text>
-  </span>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template match="abstract" mode="bibliography.mode">
 </xsl:template>
 
 <xsl:template match="abbrev" mode="bibliomixed.mode">
-  <span class="{name(.)}">
+  <xsl:if test="preceding-sibling::*">
     <xsl:apply-templates mode="bibliomixed.mode"/>
-  </span>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template match="abstract" mode="bibliomixed.mode">