This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Strange behaviour for nested, ordered lists?
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: <swhitlat at getnet dot net>, <docbook-apps at lists dot oasis-open dot org>, "Derek Hohls" <DHohls at csir dot co dot za>
- Date: Sat, 31 Jan 2004 00:12:41 -0800
- Subject: Re: [docbook-apps] Strange behaviour for nested, ordered lists?
- References: <200401301936.33076.swhitlat@getnet.net>
----- Original Message -----
From: "Steve Whitlatch" <swhitlat@getnet.net>
To: <docbook-apps@lists.oasis-open.org>; "Derek Hohls" <DHohls@csir.co.za>
Sent: Friday, January 30, 2004 6:36 PM
Subject: [docbook-apps] Strange behaviour for nested, ordered lists?
[stuff deleted]
> Anyone know how to cause lists to be indented from the column margin?
>
> That would be:
>
> text . . .
> text . . .
> text . . .
> text . . .
> text . . .
> text . . .
> listitem_text . . .
> listitem_text . . .
> nested_list_item_text . . .
> nested_list_item_text . . .
> nested_list_item_text . . .
> listitem_text . . . .
> listitem_text . . . .
> text . . . .
> text . . . .
A customization such as the following would do it. It creates a wrapper
fo:block with a margin-left property, and then uses apply-imports to
use the regular templates for formatting the list inside the block. The
test for
an ancestor list is done to avoid applying the
indent to nested lists, which are already indented by the containing list.
Otherwise they would get both indents.
<xsl:template match="orderedlist|itemizedlist">
<xsl:choose>
<xsl:when test="not(ancestor::itemizedlist or ancestor::orderedlist)">
<fo:block margin-left="0.25in">
<xsl:apply-imports/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.