]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug #1669654 Broken output if copyright <year> contains a range.
authorBob Stayton <bobs@sagehill.net>
Fri, 27 Feb 2009 07:02:45 +0000 (07:02 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 27 Feb 2009 07:02:45 +0000 (07:02 +0000)
xsl/common/common.xsl

index f1dba47a1e980da6ca5b7a1e6e86815b13f7a9db..442ebfeb371bda1ca7f9b99647bb88799dd1ab23 100644 (file)
@@ -1566,7 +1566,7 @@ year range is <quote>1991-1992</quote> but discretely it's
     <xsl:text>)</xsl:text>
   </xsl:message>
   -->
-
+    
   <xsl:choose>
     <xsl:when test="$print.ranges = 0 and count($years) &gt; 0">
       <xsl:choose>
@@ -1592,6 +1592,10 @@ year range is <quote>1991-1992</quote> but discretely it's
         <xsl:when test="$firstyear = 0">
           <!-- there weren't any years at all -->
         </xsl:when>
+        <!-- Just output a year with range in its text -->
+        <xsl:when test="contains($firstyear, '-') or contains($firstyear, ',')">
+          <xsl:value-of select="$firstyear"/>
+        </xsl:when>
         <xsl:when test="$firstyear = $lastyear">
           <xsl:value-of select="$firstyear"/>
         </xsl:when>
@@ -1608,6 +1612,22 @@ year range is <quote>1991-1992</quote> but discretely it's
         </xsl:otherwise>
       </xsl:choose>
     </xsl:when>
+    <xsl:when test="contains($firstyear, '-') or contains($firstyear, ',')">
+      <!-- Just output a year with range in its text -->
+      <xsl:value-of select="$firstyear"/>
+      <xsl:if test="count($years) != 0">
+        <xsl:text>, </xsl:text>
+      </xsl:if>
+      <xsl:call-template name="copyright.years">
+        <xsl:with-param name="years"
+              select="$years[position() &gt; 1]"/>
+        <xsl:with-param name="firstyear" select="$years[1]"/>
+        <xsl:with-param name="nextyear" select="$years[1] + 1"/>
+        <xsl:with-param name="print.ranges" select="$print.ranges"/>
+        <xsl:with-param name="single.year.ranges"
+                select="$single.year.ranges"/>
+      </xsl:call-template>
+    </xsl:when>
     <xsl:when test="$firstyear = 0">
       <xsl:call-template name="copyright.years">
         <xsl:with-param name="years"