]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix mode="fop1.foxdest" so only elements with id attribute get
authorBob Stayton <bobs@sagehill.net>
Tue, 27 Aug 2013 21:53:15 +0000 (21:53 +0000)
committerBob Stayton <bobs@sagehill.net>
Tue, 27 Aug 2013 21:53:15 +0000 (21:53 +0000)
a fox:destination in the output.

xsl/fo/fop1.xsl

index d1d01cc513426fa01723a5dd970cd70d5a1c1685..848c3a6dbe7a707c16abe8316cb42bb3fa7ef19b 100644 (file)
 </xsl:template>
 
 <xsl:template match="*" mode="fop1.foxdest">
-  <xsl:apply-templates select="*" mode="fop1.foxdest"/>
-</xsl:template>
-
-<xsl:template match="set|book|part|reference|
-                     preface|chapter|appendix|article|topic
-                     |glossary|bibliography|index|setindex
-                     |refentry
-                     |sect1|sect2|sect3|sect4|sect5|section"
-              mode="fop1.foxdest">
   <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
+    <xsl:value-of select="(@id|@xml:id)[1]"/>
   </xsl:variable>
-
   <xsl:choose>
     <xsl:when test="self::index and $generate.index = 0"/>
-    <xsl:when test="parent::*">
+    <xsl:when test="$id != ''">
       <fox:destination internal-destination="{$id}"/>
-        <xsl:apply-templates select="*" mode="fop1.foxdest"/>
+      <xsl:apply-templates select="*" mode="fop1.foxdest"/>
     </xsl:when>
     <xsl:otherwise>
-      <fox:destination internal-destination="{$id}"/>
       <xsl:apply-templates select="*" mode="fop1.foxdest"/>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
+
 <!-- Metadata support ("Document Properties" in Adobe Reader) -->
 <xsl:template name="fop1-document-information">
   <xsl:variable name="authors" select="(//author|//editor|//corpauthor|//authorgroup)[1]"/>