You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "FOP Newsgroup (@Basebeans.com)" <fo...@basebeans.com> on 2002/06/18 02:10:01 UTC

Multi-Level list

Subject: Multi-Level list
From: "Owen Thomas" <ow...@simpl.co.nz>
 ===
I have an xml file that will contain a list and each list item can contain
sub items

So the HTML page will need to look something like

1 Section A
    1.1 Sub section
    1.2 Sub section
        1.2.1 Sub Sub section
        1.2.2 Sub Sub section
    1.3 Sub section
2 Section B
3 Section C
    3.1 Sub section
    3.2 Sub section

ETC ETC ETC

The number will be stored as an attribute of the element so the xml will
look like

<Data>
    <Section listid="1">Section A</Section>
    <Section listid="1.1">Sub section</Section>
    <Section listid="1.2">Sub section</Section>
    <Section listid="1.2.1">Sub Sub section</Section>
    <Section listid="1.2.2">Sub Sub section</Section>
    <Section listid="1.3">Sub section</Section>
    <Section listid="2">Section B</Section>
    <Section listid="3">Section C</Section>
    <Section listid="3.1">Sub section</Section>
    <Section listid="3.2">Sub section</Section>
</Data>


The fo:list-block has the attributes start-indent and end-indent on the
list-item-label and list-item-body so is there any way to specify the amount
of indent dependant on an attribute.

Cheers

Owen



Re: Multi-Level list

Posted by "J.Pietschmann" <j3...@yahoo.de>.
FOP Newsgroup (@Basebeans.com) wrote:
> The fo:list-block has the attributes start-indent and end-indent on the
> list-item-label and list-item-body so is there any way to specify the amount
> of indent dependant on an attribute.

You are generating the FO with XSLT?
Try something like
  <fo:list-block start-indent="{$scale-factor
     * string-length(listid)}">
  ...
Make every line it's own list block rather than a
single list block with multiple fo:list-item elements.
Though the latter should be possible too if you use the
indent both as start-indent of the fo:list-item-label
as well as adding it to the start-indent of the
list-item-body.

J.Pietschmann