]> granicus.if.org Git - docbook-dsssl/commitdiff
Don't output square brackets if there's no biblioentry label
authorNorman Walsh <ndw@nwalsh.com>
Tue, 9 Jul 2002 12:31:49 +0000 (12:31 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 9 Jul 2002 12:31:49 +0000 (12:31 +0000)
xsl/fo/biblio.xsl
xsl/html/biblio.xsl

index 6777d98a7ecd585d173e355dc5399fde7aa24d92..e4ac7861887167e89261bed83a3e6d5cec566cda 100644 (file)
 <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:text>[</xsl:text>
       <xsl:apply-templates select="$node/abbrev[1]"/>
+      <xsl:text>] </xsl:text>
     </xsl:when>
-    <xsl:otherwise>
+    <xsl:when test="$node/@id">
+      <xsl:text>[</xsl:text>
       <xsl:value-of select="$node/@id"/>
-    </xsl:otherwise>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:otherwise><!-- nop --></xsl:otherwise>
   </xsl:choose>
-  <xsl:text>] </xsl:text>
 </xsl:template>
 
 <!-- ==================================================================== -->
index c01d864e6c3932d9b62973ac6649a0dfde103b04..646ab17ffd04f74f49ad9316c3fbaeb2e067b957 100644 (file)
 <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:text>[</xsl:text>
       <xsl:apply-templates select="$node/abbrev[1]"/>
+      <xsl:text>] </xsl:text>
     </xsl:when>
-    <xsl:otherwise>
+    <xsl:when test="$node/@id">
+      <xsl:text>[</xsl:text>
       <xsl:value-of select="$node/@id"/>
-    </xsl:otherwise>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:otherwise><!-- nop --></xsl:otherwise>
   </xsl:choose>
-  <xsl:text>] </xsl:text>
 </xsl:template>
 
 <!-- ==================================================================== -->