]> granicus.if.org Git - docbook-dsssl/commitdiff
Added a new parameter, bookmarks.collapse, that controls the initial state
authorMauritz Jeanson <mj@johanneberg.com>
Sat, 28 Mar 2009 14:17:17 +0000 (14:17 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Sat, 28 Mar 2009 14:17:17 +0000 (14:17 +0000)
of the bookmark tree. When the parameter has a non-zero value (the default),
only the top-level bookmarks are displayed initially. Otherwise, the whole
tree of bookmarks is displayed.

This is implemented for FOP 0.9X. Closes FR #1792326.

xsl/fo/fop1.xsl
xsl/fo/param.ent
xsl/fo/param.xweb
xsl/params/bookmarks.collapse.xml [new file with mode: 0644]

index 566b0fb536ccabd622fe55ba771ea7522a15e3b0..99d0663ed36436d57a498776d6a6ab791a7d5ab3 100644 (file)
 
 <!-- ==================================================================== -->
 
+<xsl:variable name="bookmarks.state">
+  <xsl:choose>
+    <xsl:when test="$bookmarks.collapse != 0">hide</xsl:when>
+    <xsl:otherwise>show</xsl:otherwise>
+  </xsl:choose>
+</xsl:variable>
+
 <xsl:template match="*" mode="fop1.outline">
   <xsl:apply-templates select="*" mode="fop1.outline"/>
 </xsl:template>
@@ -40,6 +47,9 @@
     <xsl:when test="self::index and $generate.index = 0"/>     
     <xsl:when test="parent::*">
       <fo:bookmark internal-destination="{$id}">
+       <xsl:attribute name="starting-state">
+         <xsl:value-of select="$bookmarks.state"/>
+       </xsl:attribute>
         <fo:bookmark-title>
           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
         </fo:bookmark-title>
@@ -48,6 +58,9 @@
     </xsl:when>
     <xsl:otherwise>
       <fo:bookmark internal-destination="{$id}">
+       <xsl:attribute name="starting-state">
+         <xsl:value-of select="$bookmarks.state"/>
+       </xsl:attribute>
         <fo:bookmark-title>
           <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
         </fo:bookmark-title>
index efb72905111c641ce8373f0e692297aec89f1c3f..52879e6051cc27208e22fabe9b432757fa1a4799 100644 (file)
 <!ENTITY glossdef.list.properties SYSTEM "../params/glossdef.list.properties.xml">
 <!ENTITY glossdef.block.properties SYSTEM "../params/glossdef.block.properties.xml">
 <!ENTITY glossentry.list.item.properties SYSTEM "../params/glossentry.list.item.properties.xml">
+<!ENTITY bookmarks.collapse SYSTEM "../params/bookmarks.collapse.xml">
index 79a448e1a4192f1428331a10fc35f7d0211e4f8a..3aaf75397f15e49798d11aec82d0b4fcce849181 100644 (file)
@@ -269,6 +269,7 @@ generate.section.toc.level;
 &section.container.element;
 &monospace.verbatim.font.width;
 &exsl.node.set.available;
+&bookmarks.collapse;
 </reference>
 <reference xml:id="graphics"><title>Graphics</title>
 &graphic.default.extension;
@@ -568,6 +569,7 @@ around all these parameters.</para>
 <src:fragref linkend="body.margin.top.frag"/>
 <src:fragref linkend="body.start.indent.frag"/>
 <src:fragref linkend="body.end.indent.frag"/>
+<src:fragref linkend="bookmarks.collapse.frag"/>
 <src:fragref linkend="bridgehead.in.toc.frag"/>
 <src:fragref linkend="callout.defaultcolumn.frag"/>
 <src:fragref linkend="callout.graphics.extension.frag"/>
diff --git a/xsl/params/bookmarks.collapse.xml b/xsl/params/bookmarks.collapse.xml
new file mode 100644 (file)
index 0000000..3320056
--- /dev/null
@@ -0,0 +1,31 @@
+<refentry xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:xi="http://www.w3.org/2001/XInclude"
+          xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
+          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+          version="5.0" xml:id="bookmarks.collapse">
+<refmeta>
+<refentrytitle>bookmarks.collapse</refentrytitle>
+<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo> 
+</refmeta>
+<refnamediv>
+<refname>bookmarks.collapse</refname>
+<refpurpose>Specifies the initial state of bookmarks</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment xml:id="bookmarks.collapse.frag">
+<xsl:param name="bookmarks.collapse" select="1"></xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsection><info><title>Description</title></info>
+
+<para>If non-zero, the bookmark tree is collapsed so that only the 
+top-level bookmarks are displayed initially. Otherwise, the whole tree 
+of bookmarks is displayed.</para>
+
+<para>This parameter currently works with FOP 0.93 or later.</para>
+
+</refsection>
+</refentry>