]> granicus.if.org Git - docbook-dsssl/commitdiff
Handle endofrange indexterms properly
authorNorman Walsh <ndw@nwalsh.com>
Mon, 26 Aug 2002 10:55:25 +0000 (10:55 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 26 Aug 2002 10:55:25 +0000 (10:55 +0000)
xsl/fo/autoidx.xsl

index 0da182ece2cd8b2bd01b4d8b5d46a83162c23318..fa741ccf555ee3921aba58681c51980bb974acd6 100644 (file)
       <xsl:variable name="id">
         <xsl:call-template name="object.id"/>
       </xsl:variable>
-      <fo:basic-link internal-destination="{$id}">
-        <fo:page-number-citation ref-id="{$id}"/>
-      </fo:basic-link>
+
+      <xsl:choose>
+        <xsl:when test="@startref and @class='endofrange'">
+          <fo:basic-link internal-destination="{@startref}">
+            <fo:page-number-citation ref-id="{@startref}"/>
+            <xsl:text>-</xsl:text>
+            <fo:page-number-citation ref-id="{$id}"/>
+          </fo:basic-link>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:basic-link internal-destination="{$id}">
+            <fo:page-number-citation ref-id="{$id}"/>
+          </fo:basic-link>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
         <xsl:call-template name="object.id"/>
       </xsl:variable>
 
-      <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
-      <xsl:if test="@id">
-        <xsl:text>&lt;link linkend="</xsl:text>
-        <xsl:value-of select="$id"/>
-        <xsl:text>"&gt;</xsl:text>
-      </xsl:if>
-      <fo:basic-link internal-destination="{$id}">
-        <fo:page-number-citation ref-id="{$id}"/>
-      </fo:basic-link>
-      <xsl:if test="@id">
-        <xsl:text>&lt;/link&gt;</xsl:text>
-      </xsl:if>
-      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+
+      <xsl:choose>
+        <xsl:when test="@startref and @class='endofrange'">
+          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
+          <xsl:text>&lt;link linkend="</xsl:text>
+          <xsl:value-of select="@startref"/>
+          <xsl:text>"&gt;</xsl:text>
+          <fo:basic-link internal-destination="{@startref}">
+            <fo:page-number-citation ref-id="{@startref}"/>
+            <xsl:text>-</xsl:text>
+            <fo:page-number-citation ref-id="{$id}"/>
+          </fo:basic-link>
+          <xsl:text>&lt;/link&gt;</xsl:text>
+          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
+          <xsl:if test="@id">
+            <xsl:text>&lt;link linkend="</xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text>"&gt;</xsl:text>
+          </xsl:if>
+          <fo:basic-link internal-destination="{$id}">
+            <fo:page-number-citation ref-id="{$id}"/>
+          </fo:basic-link>
+          <xsl:if test="@id">
+            <xsl:text>&lt;/link&gt;</xsl:text>
+          </xsl:if>
+          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>