]> granicus.if.org Git - docbook-dsssl/commitdiff
Support spacing=compact on itemizedlist and orderedlist (Bug #501063)
authorNorman Walsh <ndw@nwalsh.com>
Mon, 13 May 2002 13:38:31 +0000 (13:38 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 13 May 2002 13:38:31 +0000 (13:38 +0000)
xsl/fo/lists.xsl
xsl/fo/param.ent
xsl/fo/param.xweb
xsl/params/compact.list.item.spacing.xml [new file with mode: 0644]

index 51272646af6939cccd33a4122bc8122b7ac7fde3..ea1dff01e20d05d9ee014eaacdd199bc326b1419 100644 (file)
@@ -50,7 +50,7 @@
     </xsl:call-template>
   </xsl:variable>
 
-  <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+  <xsl:variable name="item.contents">
     <fo:list-item-label end-indent="label-end()">
       <fo:block>
         <xsl:choose>
     <fo:list-item-body start-indent="body-start()">
       <xsl:apply-templates/>
     </fo:list-item-body>
-  </fo:list-item>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="parent::*/@spacing = 'compact'">
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="compact.list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="orderedlist">
     </xsl:choose>
   </xsl:variable>
 
-  <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+  <xsl:variable name="item.contents">
     <fo:list-item-label end-indent="label-end()">
       <fo:block>
         <xsl:choose>
     <fo:list-item-body start-indent="body-start()">
       <xsl:apply-templates/>
     </fo:list-item-body>
-  </fo:list-item>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="parent::*/@spacing = 'compact'">
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="compact.list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="listitem/para[1]
index 8ac9b16d632f52ddc3fbedf9d6913513ef659772..50cc999832e05b24ec53b1a061da601b85396af5 100644 (file)
@@ -29,6 +29,7 @@
 <!ENTITY chapter.autolabel SYSTEM "../params/chapter.autolabel.xml">
 <!ENTITY column.count SYSTEM "../params/column.count.xml">
 <!ENTITY column.count.of.index SYSTEM "../params/column.count.of.index.xml">
+<!ENTITY compact.list.item.spacing SYSTEM "../params/compact.list.item.spacing.xml">
 <!ENTITY component.title.properties SYSTEM "../params/component.title.properties.xml">
 <!ENTITY default.table.width SYSTEM "../params/default.table.width.xml">
 <!ENTITY default.units SYSTEM "../params/default.units.xml">
index feac37e9682cccd03bd75b3270b248b2ec0db091..4f6294c08da45b5cbc89da272d620629dd893e76 100644 (file)
@@ -302,6 +302,7 @@ zero by default, so this is simply the page-master region-left.
 <reference><title>Lists</title>
 &list.block.spacing;
 &list.item.spacing;
+&compact.list.item.spacing;
 </reference>
 
 <reference><title>Cross References</title>
@@ -399,6 +400,7 @@ around all these parameters.</para>
 <src:fragref linkend="chapter.autolabel.frag"/>
 <src:fragref linkend="column.count.frag"/>
 <src:fragref linkend="column.count.of.index.frag"/>
+<src:fragref linkend="compact.list.item.spacing.frag"/>
 <src:fragref linkend="component.title.properties.frag"/>
 <src:fragref linkend="default.table.width.frag"/>
 <src:fragref linkend="default.units.frag"/>
diff --git a/xsl/params/compact.list.item.spacing.xml b/xsl/params/compact.list.item.spacing.xml
new file mode 100644 (file)
index 0000000..43a1b69
--- /dev/null
@@ -0,0 +1,19 @@
+<refentry id="compact.list.item.spacing">
+<refnamediv>
+<refname>compact.list.item.spacing</refname>
+<refpurpose>What space do you want between list items (when spacing=compact)?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='compact.list.item.spacing.frag'><xsl:attribute-set name="compact.list.item.spacing">
+  <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
+</xsl:attribute-set></src:fragment>
+</refsynopsisdiv>
+<refsect1><title>Description</title>
+<para>Specify what spacing you want between each list item when
+<sgmltag class="attribute">spacing</sgmltag> is
+<quote><literal>compact</literal></quote>.</para>
+</refsect1>
+</refentry>