]> granicus.if.org Git - docbook-dsssl/commitdiff
Output .sp macro in mixed blocks where we were outputting
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 9 Aug 2005 09:11:02 +0000 (09:11 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 9 Aug 2005 09:11:02 +0000 (09:11 +0000)
completely blank line before. Thanks (again) to Costin Stroie for
pointing out the problems and providing a test case.

Also, corrected the test for checking first preceding siblings of
text nodes in mixed blocks (the test is used for determining
whether or not we need to insert a line break before those nodes.)

xsl/manpages/block.xsl
xsl/manpages/lists.xsl
xsl/manpages/utility.xsl

index e32e2f6947173b4228a30e5810ddd863544cbcb0..b1471f2ef1c5e6446d5ae60fed88629b0fecb006 100644 (file)
@@ -37,7 +37,7 @@
     <xsl:apply-templates/>
   </xsl:variable>
   <xsl:value-of select="normalize-space($content)"/>
-  <xsl:text>&#10;</xsl:text>
+  <xsl:text>.sp&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="address|literallayout|programlisting|screen|synopsis">
   <xsl:apply-templates/>
   <xsl:text>&#10;</xsl:text>
   <xsl:text>.fi&#10;</xsl:text>
+  <!-- * if first following sibling node of this verbatim -->
+  <!-- * environment is a text node, output a line of space before it -->
+  <xsl:if test="following-sibling::node()[1][name(.) = '']">
+    <xsl:text>.sp&#10;</xsl:text>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template match="informalexample">
index 7d05578b4df29808d920a3f7bdb173cdc81f1ef0..1b4e54994ecde35c1ea7ff774ca7a15e93372a0c 100644 (file)
@@ -23,7 +23,7 @@
                 following-sibling::remark">
     <!-- * Make sure multiple paragraphs within a list item don't -->
     <!-- * merge together.                                        -->
-    <xsl:text>&#10;</xsl:text>
+    <xsl:text>.sp&#10;</xsl:text>
   </xsl:if>
 </xsl:template>
 
index 726df8176670bdab5c85d8ac586114b2ac4c1440..9d3546cdf7b0a60f340477a4fef83e91e2a1a93a 100644 (file)
           </xsl:variable>
           <xsl:if
               test="starts-with(translate(.,'&#9;&#10;&#13; ','    '), ' ')
-                    and preceding-sibling::node()[name(.)!='']
+                    and preceding-sibling::node()[1][name(.)!='']
                     and normalize-space($content) != ''
                     and not(
-                    preceding-sibling::variablelist[1] or
-                    preceding-sibling::glosslistlist[1] or
-                    preceding-sibling::itemizedlist[1] or
-                    preceding-sibling::orderededlist[1] or
-                    preceding-sibling::procedure[1]
+                    preceding-sibling::*[1][
+                    self::variablelist or
+                    self::glosslistlist or
+                    self::itemizedlist or
+                    self::orderededlist or
+                    self::procedure or
+                    self::address or
+                    self::literallayout or
+                    self::programlisting or
+                    self::screen
+                    ]
                     )
                     ">
             <xsl:text>&#10;</xsl:text>
           <xsl:value-of select="normalize-space($content)"/>
           <xsl:if
               test="translate(substring(., string-length(.), 1),'&#9;&#10;&#13; ','    ')  = ' '
-                    and following-sibling::node()[name(.)!='']
+                    and following-sibling::node()[1][name(.)!='']
                     ">
             <xsl:if test="normalize-space($content) != ''">
               <xsl:text>&#10;</xsl:text>