]> granicus.if.org Git - docbook-dsssl/commitdiff
Apply patch to support named destination in fop1.xsl, per Sourceforge
authorBob Stayton <bobs@sagehill.net>
Fri, 1 Oct 2010 04:44:57 +0000 (04:44 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 1 Oct 2010 04:44:57 +0000 (04:44 +0000)
bug report #3029845.

xsl/fo/docbook.xsl
xsl/fo/fop1.xsl
xsl/fo/xref.xsl

index 1b0cc404964184d5d989ca8aef9df1ba8f126ec4..2984a9568b8ffed4c46b011db844045e1f975b6e 100644 (file)
           <xsl:copy-of select="$bookmarks"/>
         </fo:bookmark-tree>
       </xsl:if>
+      <xsl:apply-templates select="$document.element" 
+                           mode="fop1.foxdest"/>
     </xsl:if>
 
     <xsl:if test="$xep.extensions != 0">
index df9baf8043db8d5780c81a1cff5f7b648ffae9fc..5cb697f7f2b40ec76c6b32e85bf1f502bf5087b3 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
+                     |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:variable>
+  <xsl:variable name="bookmark-label">
+    <xsl:apply-templates select="." mode="object.title.markup"/>
+  </xsl:variable>
+  <!--xsl:if test="$id != ''">
+    <fox:destination internal-destination="{$id}"/>
+  </xsl:if-->
+
+  <!-- Put the root element bookmark at the same level as its children -->
+  <!-- If the object is a set or book, generate a bookmark for the toc -->
+
+  <xsl:choose>
+    <xsl:when test="self::index and $generate.index = 0"/>     
+    <xsl:when test="parent::*">
+      <fox:destination internal-destination="{$id}"/>
+        <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]"/>
index fb23768df53253727276024279e23a52abcf454c..e2bad57ee2d19ea30b06730f714e851e3cb15986 100644 (file)
         </xsl:when>
         <xsl:when test="$href != ''">
           <xsl:choose>
+            <xsl:when test="$fop1.extensions != 0">
+              <xsl:variable name="mybeg" select="substring-before($href,'#')"/>
+              <xsl:variable name="myend" select="substring-after($href,'#')"/>
+              <fo:basic-link external-destination="url({concat($mybeg,'#dest=',$myend)})"
+                             xsl:use-attribute-sets="olink.properties">
+                <xsl:copy-of select="$hottext"/>
+              </fo:basic-link>
+              <xsl:copy-of select="$olink.page.citation"/>
+              <xsl:copy-of select="$olink.docname.citation"/>
+            </xsl:when>
             <xsl:when test="$xep.extensions != 0">
               <fo:basic-link external-destination="url({$href})"
                              xsl:use-attribute-sets="olink.properties">