]> granicus.if.org Git - docbook-dsssl/commitdiff
fix issue #99 multiple indexes with autolink.index.see fails with FOP
authorbobstayton <bobs@sagehill.net>
Thu, 19 Jul 2018 21:59:29 +0000 (14:59 -0700)
committerbobstayton <bobs@sagehill.net>
Fri, 20 Jul 2018 05:43:42 +0000 (22:43 -0700)
xsl/fo/autoidx.xsl
xsl/params/autolink.index.see.xml

index aff7c91399adeb5007c5cc076e0976e664ae2096..b92e81b2d848c3f75210484fc41c363a021d586f 100644 (file)
 
   <fo:block>
     <xsl:if test="$autolink.index.see != 0">
-      <xsl:attribute name="id">
-        <xsl:text>ientry-</xsl:text>
-        <xsl:call-template name="object.id"/>
-      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="$fop1.extensions != 0 and count(//d:index|//d:setindex) &gt; 1">
+          <!-- more than one index can generate duplicate ids
+               which cause FOP to fail -->
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="id">
+            <xsl:text>ientry-</xsl:text>
+            <xsl:call-template name="object.id"/>
+          </xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
     <xsl:if test="$axf.extensions != 0">
       <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
       <xsl:when test="$autolink.index.see = 0">
          <xsl:value-of select="$see"/>
       </xsl:when>
+      <xsl:when test="$fop1.extensions != 0 and count(//d:index|//d:setindex) &gt; 1">
+         <xsl:value-of select="$see"/>
+      </xsl:when>
       <xsl:when test="$seetarget">
         <fo:basic-link internal-destination="{$linkend}"
                        xsl:use-attribute-sets="xref.properties">
         <xsl:when test="$autolink.index.see = 0">
           <xsl:value-of select="$seealso"/>
         </xsl:when>
+        <xsl:when test="$fop1.extensions != 0 and count(//d:index|//d:setindex) &gt; 1">
+           <xsl:value-of select="$seealso"/>
+        </xsl:when>
         <xsl:when test="$seealsotarget">
           <fo:basic-link internal-destination="{$linkend}"
                          xsl:use-attribute-sets="xref.properties">
index ace26d03b51ad6b3f15d6e95a9b79187a04b3c1b..72171f493186acdb0cc649675ea835d3937bcd99 100755 (executable)
@@ -53,5 +53,12 @@ no automatic links from see and seealso
 are formed within the index.  Any manual links are
 still processed, however.</para>
 
+<para>If a document contains more than one index, then any indexterms used
+in more than one index will generate duplicate id attributes, which will 
+cause the FOP processor to fail. Therefore the stylesheet turns this feature off
+if it detects more than one index and setindex, and the fop1.extensions parameter
+is nonzero.
+</para>
+
 </refsection>
 </refentry>