]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix XEP support for pdf bookmarks
authorNorman Walsh <ndw@nwalsh.com>
Fri, 22 Jun 2001 19:31:37 +0000 (19:31 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 22 Jun 2001 19:31:37 +0000 (19:31 +0000)
xsl/fo/docbook.xsl
xsl/fo/xep.xsl

index 181b2aa227f3fdc19f05531565833e9e571d3e4c..6003c15b7bd903a01661a47e4c4360631d3c6b21 100644 (file)
   <fo:root font-family="{$body.font.family}"
            font-size="{$body.font.size}"
            text-align="{$alignment}">
+    <xsl:if test="$xep.extensions != 0">
+      <xsl:call-template name="xep-document-information"/>
+    </xsl:if>
     <xsl:call-template name="setup.pagemasters"/>
     <xsl:choose>
       <xsl:when test="$rootid != ''">
               <xsl:apply-templates select="id($rootid)" mode="outline"/>
             </xsl:if>
             <xsl:if test="$xep.extensions != 0">
-              <xsl:apply-templates select="id($rootid)" mode="xep.outline"/>
+              <rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions">
+                <xsl:apply-templates select="id($rootid)" mode="xep.outline"/>
+              </rx:outline>
             </xsl:if>
             <xsl:apply-templates select="id($rootid)"/>
           </xsl:otherwise>
           <xsl:apply-templates mode="outline"/>
         </xsl:if>
         <xsl:if test="$xep.extensions != 0">
-          <xsl:apply-templates mode="xep.outline"/>
+          <rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions">
+            <xsl:apply-templates mode="xep.outline"/>
+          </rx:outline>
         </xsl:if>
         <xsl:apply-templates/>
       </xsl:otherwise>
index e1c3a02b3a43ac761c9d67d569bf7f19c5568af6..61f48eedd5c4946e1cc6a3c61856681cd485d096 100644 (file)
      Document information
      ******************************************************************** -->
 
-<xsl:template name="document-information">
-  <xsl:param name="document-title" select="//title[1]"/>
+<xsl:template name="xep-document-information">
   <rx:meta-info>
+    <xsl:if test="//author[1]">
+      <xsl:element name="rx:meta-field">
+        <xsl:attribute name="name">author</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:call-template name="person.name">
+            <xsl:with-param name="node" select="//author[1]"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+
+    <xsl:variable name="title">
+      <xsl:apply-templates select="/*[1]" mode="label.markup"/>
+      <xsl:apply-templates select="/*[1]" mode="title.markup"/>
+    </xsl:variable>
+
     <xsl:element name="rx:meta-field">
-      <xsl:attribute name="name">author</xsl:attribute>
+      <xsl:attribute name="name">title</xsl:attribute>
       <xsl:attribute name="value">
-        <xsl:choose>
-          <xsl:when test="bookinfo/author">
-            <xsl:value-of select="bookinfo/author"/>
-          </xsl:when>
-          <xsl:otherwise>
-          </xsl:otherwise>
-        </xsl:choose>
+        <xsl:value-of select="$title"/>
       </xsl:attribute>
     </xsl:element>
-    <xsl:element name="rx:meta-field">
-      <xsl:attribute name="name">title</xsl:attribute>
-        <xsl:attribute name="value">
-            <xsl:value-of select="$document-title"/>
-        </xsl:attribute>
-    </xsl:element>
   </rx:meta-info>
 </xsl:template>
 
@@ -69,8 +72,8 @@
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <xsl:variable name="bookmark-label">
-    <xsl:apply-templates select="." mode="label.content"/>
-    <xsl:apply-templates select="." mode="title.content"/>
+    <xsl:apply-templates select="." mode="label.markup"/>
+    <xsl:apply-templates select="." mode="title.markup"/>
   </xsl:variable>
 
   <rx:bookmark internal-destination="{$id}">
       <xsl:value-of select="$bookmark-label"/>
     </rx:bookmark-label>
 
-  <xsl:if test="part|preface|chapter|appendix">
+    <xsl:if test="part|preface|chapter|appendix">
       <xsl:apply-templates select="part|preface|chapter|appendix"
                            mode="xep.outline"/>
-  </xsl:if>
+    </xsl:if>
   </rx:bookmark>
 </xsl:template>
 
@@ -91,8 +94,8 @@
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <xsl:variable name="bookmark-label">
-    <xsl:apply-templates select="." mode="label.content"/>
-    <xsl:apply-templates select="." mode="title.content"/>
+    <xsl:apply-templates select="." mode="label.markup"/>
+    <xsl:apply-templates select="." mode="title.markup"/>
   </xsl:variable>
 
   <rx:bookmark internal-destination="{$id}">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <xsl:variable name="bookmark-label">
-    <xsl:apply-templates select="." mode="label.content"/>
-    <xsl:apply-templates select="." mode="title.content"/>
+    <xsl:apply-templates select="." mode="label.markup"/>
+    <xsl:apply-templates select="." mode="title.markup"/>
   </xsl:variable>
 
   <rx:bookmark internal-destination="{$id}">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <xsl:variable name="bookmark-label">
-    <xsl:apply-templates select="." mode="label.content"/>
-    <xsl:apply-templates select="." mode="title.content"/>
+    <xsl:apply-templates select="." mode="label.markup"/>
+    <xsl:apply-templates select="." mode="title.markup"/>
   </xsl:variable>
 
   <rx:bookmark internal-destination="{$id}">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <xsl:variable name="bookmark-label">
-    <xsl:apply-templates select="." mode="label.content"/>
-    <xsl:apply-templates select="." mode="title.content"/>
+    <xsl:apply-templates select="." mode="label.markup"/>
+    <xsl:apply-templates select="." mode="title.markup"/>
   </xsl:variable>
 
   <rx:bookmark internal-destination="{$id}">