Loading ...
Sorry, an error occurred while loading the content.

hierarchical lists

Expand Messages
  • torsten krohn | tsdb | the simpsons data
    Hi! I d like to generate hierarchical lists from source: topic 1 subtopic 1 subtopic 2 subsubtopic 1
    Message 1 of 2 , May 8 9:17 AM
    • 0 Attachment
      Hi!

      I'd like to generate hierarchical lists from source:

      <ul>
      <li>topic 1</li>
      <ul>
      <li>subtopic 1</li>
      <li>subtopic 2</li>
      <ul>
      <li>subsubtopic 1</li>
      </ul>
      </ul>
      <li>topic 2</li>
      </ul>

      to

      * topic 1
      + subtopic 1
      + subtopic 2
      - subsubtopic 1
      * topic 2

      but I don't know how to add margin-left or padding-left for a deeper
      topic than the first level!? Thank you for help! :)

      Torsten
    • G. Ken Holman
      ... By not using margin or padding, but by using the constructs. And, your use of nested lists is not easily mappable to XSL-FO nested lists ... I
      Message 2 of 2 , May 8 10:12 AM
      • 0 Attachment
        At 2005-05-08 18:17 +0200, torsten krohn | tsdb | the simpsons database wrote:
        >I'd like to generate hierarchical lists from source:
        >
        ><ul>
        ><li>topic 1</li>
        ><ul>
        > <li>subtopic 1</li>
        > <li>subtopic 2</li>
        > <ul>
        > <li>subsubtopic 1</li>
        > </ul>
        ></ul>
        ><li>topic 2</li>
        ></ul>
        >
        >to
        >
        >* topic 1
        > + subtopic 1
        > + subtopic 2
        > - subsubtopic 1
        >* topic 2
        >
        >but I don't know how to add margin-left or padding-left for a deeper
        >topic than the first level!?

        By not using margin or padding, but by using the <list-block> constructs.

        And, your use of nested lists is not easily mappable to XSL-FO nested lists
        ... I actually use this example of nesting lists in my XSL-FO classroom
        because it is more difficult than "traditional" nested lists that put the
        nested list *inside* a list item, unlike as a sibling to list items as in
        your example. Not many students use nested lists in their company's
        structures as you do.

        So, first step is to transform the base <ul> element to a <list-block> and
        to transform all <li> elements to <list-item> constructs. You will need to
        decide what content to use for the <list-item-label> and you put your <li>
        content into <list-item-body> constructs. Using the provisional attributes
        you can tune the indentation used for each level of indentation.

        The awkward part is accommodating the nested list in what I call in class a
        "ghost" list item: XSL-FO <list-block> accepts *only* <list-item>
        children, so you cannot just transliterate your nested <ul> into
        <list-block> ... you are obliged to create a ghost list item, with a ghost
        list item label that is empty (using an empty block to produce your example
        above, unless in the future you plan to treat the nested list as a list
        item), and put the nested <list-block> into the <list-item-body> of the
        ghost list item. Then, your XSL-FO list structures will be properly nested.

        So, it isn't just a straightforward transliteration as it is with many
        lists, but it isn't hard to overcome either by using a ghost list item for
        every nested list's list block.

        I hope this helps.

        . . . . . . . Ken

        --
        World-wide on-site corporate, govt. & user group XML/XSL training.
        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
        Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
        Legal business disclaimers: http://www.CraneSoftwrights.com/legal
      Your message has been successfully submitted and would be delivered to recipients shortly.