]> granicus.if.org Git - docbook-dsssl/commitdiff
Processing of listitems now processes and preserves order of comments and PIs.
authorBob Stayton <bobs@sagehill.net>
Tue, 2 Dec 2003 00:01:07 +0000 (00:01 +0000)
committerBob Stayton <bobs@sagehill.net>
Tue, 2 Dec 2003 00:01:07 +0000 (00:01 +0000)
xsl/fo/lists.xsl

index 4cd0e6e8985eee444a6e996350dda19f57611d84..a58d1a540c35703b9aa773e88a43a35f1084a5ac 100644 (file)
     <xsl:apply-templates select="title" mode="list.title.mode"/>
   </xsl:if>
 
-  <xsl:apply-templates select="*[not(self::listitem 
-                                  or self::title
-                                  or self::titleabbrev)]"/>
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+      select="*[not(self::listitem
+                or self::title
+                or self::titleabbrev)]
+              |comment()[not(preceding-sibling::listitem)]
+              |processing-instruction()[not(preceding-sibling::listitem)]"/>
 
   <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing"
                  provisional-label-separation="0.2em">
         <xsl:otherwise>1.5em</xsl:otherwise>
       </xsl:choose>
     </xsl:attribute>
-    <xsl:apply-templates select="listitem"/>
+    <xsl:apply-templates 
+          select="listitem
+                  |comment()[preceding-sibling::listitem]
+                  |processing-instruction()[preceding-sibling::listitem]"/>
   </fo:list-block>
 </xsl:template>
 
     <xsl:apply-templates select="title" mode="list.title.mode"/>
   </xsl:if>
 
-  <xsl:apply-templates select="*[not(self::listitem 
-                                  or self::title
-                                  or self::titleabbrev)]"/>
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+      select="*[not(self::listitem
+                or self::title
+                or self::titleabbrev)]
+              |comment()[not(preceding-sibling::listitem)]
+              |processing-instruction()[not(preceding-sibling::listitem)]"/>
 
   <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing"
                  provisional-label-separation="0.2em">
         <xsl:otherwise>2em</xsl:otherwise>
       </xsl:choose>
     </xsl:attribute>
-    <xsl:apply-templates select="listitem"/>
+    <xsl:apply-templates 
+          select="listitem
+                  |comment()[preceding-sibling::listitem]
+                  |processing-instruction()[preceding-sibling::listitem]"/>
   </fo:list-block>
 </xsl:template>
 
     <xsl:apply-templates select="title" mode="list.title.mode"/>
   </xsl:if>
 
-  <xsl:apply-templates select="*[not(self::varlistentry
-                                  or self::title
-                                  or self::titleabbrev)]"/>
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+    select="*[not(self::varlistentry
+              or self::title
+              or self::titleabbrev)]
+            |comment()[not(preceding-sibling::varlistentry)]
+            |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
 
   <fo:list-block id="{$id}"
                  provisional-distance-between-starts=
                     "{$termlength}+{$label-separation}"
                  provisional-label-separation="{$label-separation}"
                  xsl:use-attribute-sets="list.block.spacing">
-    <xsl:apply-templates select="varlistentry" mode="vl.as.list"/>
+    <xsl:apply-templates mode="vl.as.list"
+      select="varlistentry
+              |comment()[preceding-sibling::varlistentry]
+              |processing-instruction()[preceding-sibling::varlistentry]"/>
   </fo:list-block>
 </xsl:template>
 
     <xsl:apply-templates select="title" mode="list.title.mode"/>
   </xsl:if>
 
-  <xsl:apply-templates select="*[not(self::varlistentry
-                                  or self::title
-                                  or self::titleabbrev)]"/>
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+    select="*[not(self::varlistentry
+              or self::title
+              or self::titleabbrev)]
+            |comment()[not(preceding-sibling::varlistentry)]
+            |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
 
   <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
-    <xsl:apply-templates select="varlistentry" mode="vl.as.blocks"/>
+    <xsl:apply-templates mode="vl.as.blocks"
+      select="varlistentry
+              |comment()[preceding-sibling::varlistentry]
+              |processing-instruction()[preceding-sibling::varlistentry]"/>
   </fo:block>
 </xsl:template>
 
     </xsl:choose>
   </xsl:variable>
 
+  <!-- Preserve order of PIs and comments -->
   <xsl:variable name="preamble"
-                select="*[not(self::step
-                          or self::titleabbrev
-                          or self::title)]"/>
-  <xsl:variable name="steps" select="step"/>
+        select="*[not(self::step
+                  or self::title
+                  or self::titleabbrev)]
+                |comment()[not(preceding-sibling::step)]
+                |processing-instruction()[not(preceding-sibling::step)]"/>
+
+  <xsl:variable name="steps" 
+                select="step
+                        |comment()[preceding-sibling::step]
+                        |processing-instruction()[preceding-sibling::step]"/>
 
   <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
     <xsl:if test="./title and $placement = 'before'">