]> granicus.if.org Git - docbook-dsssl/commitdiff
Support the keep-together processing-instruction on programlisting, screen, synopsis...
authorDavid Cramer <david@thingbag.net>
Tue, 30 Aug 2011 13:30:50 +0000 (13:30 +0000)
committerDavid Cramer <david@thingbag.net>
Tue, 30 Aug 2011 13:30:50 +0000 (13:30 +0000)
xsl/fo/verbatim.xsl

index 22f21c6dd8ad3e6c74521ccfef2b517a45b0b085..63e702b2759fb40184c7208a2421ffe768f44046 100644 (file)
     </xsl:choose>
   </xsl:variable>
 
+  <xsl:variable name="keep.together">
+    <xsl:call-template name="pi.dbfo_keep-together"/>
+  </xsl:variable>
+
   <xsl:variable name="block.content">
     <xsl:choose>
       <xsl:when test="$shade.verbatim != 0">
         <fo:block id="{$id}"
              xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
+         <xsl:if test="$keep.together != ''">
+           <xsl:attribute name="keep-together.within-column"><xsl:value-of
+           select="$keep.together"/></xsl:attribute>
+         </xsl:if>
           <xsl:choose>
             <xsl:when test="$hyphenate.verbatim != 0 and 
                             $exsl.node.set.available != 0">
       <xsl:otherwise>
         <fo:block id="{$id}"
                   xsl:use-attribute-sets="monospace.verbatim.properties">
+         <xsl:if test="$keep.together != ''">
+           <xsl:attribute name="keep-together.within-column"><xsl:value-of
+           select="$keep.together"/></xsl:attribute>
+         </xsl:if>
           <xsl:choose>
             <xsl:when test="$hyphenate.verbatim != 0 and 
                             $exsl.node.set.available != 0">
 
   <xsl:variable name="id"><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="content">
     <xsl:choose>
       <xsl:when test="$suppress-numbers = '0'
         <xsl:when test="$shade.verbatim != 0">
           <fo:block id="{$id}"
                     xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
-
+           <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:block>
         </xsl:when>
         <xsl:otherwise>
           <fo:block id="{$id}"
                     xsl:use-attribute-sets="monospace.verbatim.properties">
+           <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:block>
         </xsl:otherwise>
         <xsl:when test="$shade.verbatim != 0">
           <fo:block id="{$id}"
                     xsl:use-attribute-sets="verbatim.properties shade.verbatim.style">
+           <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:block>
         </xsl:when>
         <xsl:otherwise>
           <fo:block id="{$id}"
                     xsl:use-attribute-sets="verbatim.properties">
+           <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:block>
         </xsl:otherwise>