]> granicus.if.org Git - docbook-dsssl/commitdiff
Arrange to use only a single fo:block for shading to avoid a bug in earlier versions...
authorNorman Walsh <ndw@nwalsh.com>
Mon, 20 Jan 2003 18:57:39 +0000 (18:57 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 20 Jan 2003 18:57:39 +0000 (18:57 +0000)
xsl/fo/verbatim.xsl

index 234e527c125372b2c87e736973a62b9489f11b9e..068255fc53c9b79e80f676df022adedfa5bedf1d 100644 (file)
     </xsl:choose>
   </xsl:variable>
 
-  <fo:block wrap-option='no-wrap'
-            white-space-collapse='false'
-            linefeed-treatment="preserve"
-            xsl:use-attribute-sets="monospace.verbatim.properties">
-    <xsl:choose>
-      <xsl:when test="$shade.verbatim != 0">
-        <fo:block space-before="0pt" space-after="0pt"
-                  xsl:use-attribute-sets="shade.verbatim.style">
-          <xsl:copy-of select="$content"/>
-        </fo:block>
-      </xsl:when>
-      <xsl:otherwise>
+  <xsl:choose>
+    <xsl:when test="$shade.verbatim != 0">
+      <fo:block wrap-option='no-wrap'
+                white-space-collapse='false'
+                linefeed-treatment="preserve"
+                xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
+
         <xsl:copy-of select="$content"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </fo:block>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block wrap-option='no-wrap'
+                white-space-collapse='false'
+                linefeed-treatment="preserve"
+                xsl:use-attribute-sets="monospace.verbatim.properties">
+        <xsl:copy-of select="$content"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="literallayout">
   <xsl:param name="suppress-numbers" select="'0'"/>
 
-  <xsl:variable name="raw.content">
+  <xsl:variable name="content">
     <xsl:choose>
       <xsl:when test="$suppress-numbers = '0'
                       and @linenumbering = 'numbered'
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:variable name="content">
-    <xsl:choose>
-      <xsl:when test="@class='monospaced' and $shade.verbatim != 0">
-        <fo:block space-before="0pt" space-after="0pt"
-                  xsl:use-attribute-sets="shade.verbatim.style">
-          <xsl:copy-of select="$raw.content"/>
-        </fo:block>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy-of select="$raw.content"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
   <xsl:choose>
     <xsl:when test="@class='monospaced'">
-      <fo:block wrap-option='no-wrap'
-                linefeed-treatment="preserve"
-                white-space-collapse='false'
-                xsl:use-attribute-sets="monospace.verbatim.properties">
-        <xsl:copy-of select="$content"/>
-      </fo:block>
+      <xsl:choose>
+        <xsl:when test="$shade.verbatim != 0">
+          <fo:block wrap-option='no-wrap'
+                    white-space-collapse='false'
+                    linefeed-treatment="preserve"
+                    xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
+
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block wrap-option='no-wrap'
+                    white-space-collapse='false'
+                    linefeed-treatment="preserve"
+                    xsl:use-attribute-sets="monospace.verbatim.properties">
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
-      <fo:block wrap-option='no-wrap'
-                linefeed-treatment="preserve"
-                white-space-collapse='false'
-                xsl:use-attribute-sets="verbatim.properties">
-        <xsl:copy-of select="$content"/>
-      </fo:block>
+      <xsl:choose>
+        <xsl:when test="$shade.verbatim != 0">
+          <fo:block wrap-option='no-wrap'
+                    white-space-collapse='false'
+                    linefeed-treatment="preserve"
+                    xsl:use-attribute-sets="verbatim.properties shade.verbatim.style">
+
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block wrap-option='no-wrap'
+                    white-space-collapse='false'
+                    linefeed-treatment="preserve"
+                    xsl:use-attribute-sets="verbatim.properties">
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>