]> granicus.if.org Git - docbook-dsssl/commitdiff
Add support for dbfo keep-together processing instruction for
authorBob Stayton <bobs@sagehill.net>
Sun, 22 Mar 2009 07:56:48 +0000 (07:56 +0000)
committerBob Stayton <bobs@sagehill.net>
Sun, 22 Mar 2009 07:56:48 +0000 (07:56 +0000)
entire list instances.

xsl/fo/lists.xsl

index 717a48e5188472a68e8a840133dbc82a43b8dee8..c44b72697d5c97669c2871533106697d53c36228 100644 (file)
     <xsl:call-template name="object.id"/>
   </xsl:variable>
 
+  <xsl:variable name="keep.together">
+    <xsl:call-template name="pi.dbfo_keep-together"/>
+  </xsl:variable>
+
   <xsl:variable name="pi-label-width">
     <xsl:call-template name="pi.dbfo_label-width"/>
   </xsl:variable>
         <xsl:attribute name="provisional-distance-between-starts">
           <xsl:value-of select="$label-width"/>
         </xsl:attribute>
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </fo:list-block>
     </xsl:when>
         <xsl:attribute name="provisional-distance-between-starts">
           <xsl:value-of select="$label-width"/>
         </xsl:attribute>
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </fo:list-block>
     </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
 
+  <xsl:variable name="keep.together">
+    <xsl:call-template name="pi.dbfo_keep-together"/>
+  </xsl:variable>
+
   <xsl:if test="title">
     <xsl:apply-templates select="title" mode="list.title.mode"/>
   </xsl:if>
         <xsl:attribute name="provisional-distance-between-starts">
           <xsl:value-of select="$label-width"/>
         </xsl:attribute>
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </fo:list-block>
     </xsl:when>
         <xsl:attribute name="provisional-distance-between-starts">
           <xsl:value-of select="$label-width"/>
         </xsl:attribute>
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </fo:list-block>
     </xsl:otherwise>
     <xsl:call-template name="object.id"/>
   </xsl:variable>
 
+  <xsl:variable name="keep.together">
+    <xsl:call-template name="pi.dbfo_keep-together"/>
+  </xsl:variable>
+
   <xsl:variable name="term-width">
     <xsl:call-template name="pi.dbfo_term-width"/>
   </xsl:variable>
                      provisional-distance-between-starts=
                         "{$distance-between-starts}"
                      provisional-label-separation="{$label-separation}">
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </fo:list-block>
     </xsl:when>
                         "{$distance-between-starts}"
                      provisional-label-separation="{$label-separation}"
                      xsl:use-attribute-sets="list.block.spacing">
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </fo:list-block>
     </xsl:otherwise>
     <xsl:call-template name="pi.dbfo_list-presentation"/>
   </xsl:variable>
 
+  <xsl:variable name="keep.together">
+    <xsl:call-template name="pi.dbfo_keep-together"/>
+  </xsl:variable>
+
   <xsl:variable name="id">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
   <xsl:choose>
     <xsl:when test="$presentation = 'table'">
       <fo:block id="{$id}">
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:apply-templates select="." mode="seglist-table"/>
       </fo:block>
     </xsl:when>
     <xsl:when test="$presentation = 'list'">
       <fo:block id="{$id}">
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:apply-templates/>
       </fo:block>
     </xsl:when>
     <xsl:when test="$segmentedlist.as.table != 0">
       <fo:block id="{$id}">
+        <xsl:if test="$keep.together != ''">
+          <xsl:attribute name="keep-together.within-column"><xsl:value-of
+                          select="$keep.together"/></xsl:attribute>
+        </xsl:if>
         <xsl:apply-templates select="." mode="seglist-table"/>
       </fo:block>
     </xsl:when>
     <xsl:otherwise>
       <fo:block id="{$id}">
+        <xsl:variable name="keep.together">
+          <xsl:call-template name="pi.dbfo_keep-together"/>
+        </xsl:variable>
+
         <xsl:apply-templates/>
       </fo:block>
     </xsl:otherwise>