Menu

Order for nested lists ?

2005-01-05
2013-04-16
  • Vincent Osele

    Vincent Osele - 2005-01-05

    Hello,

    I have a bullet list that include another bullet list.
    With sdocbook (I think with other format also), i generate this:
    <itemizedlist>
      <listitem>first item level 1</listitem>
      <itemizedlist>
        <listitem>first item level 2</listitem>
      </itemizedlist>
    </itemizedlist>

    This is badly converted to html from docbook because (I think) it must be:
    <itemizedlist>
      <listitem>first item level 1
        <itemizedlist>
          <listitem>first item level 2</listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
    The second itemizedlist is a part of the itemlist and is embed in it definition.

    I correct this with a new transition to remove the extra closed item:
    <transition start="Slb2" key="lb2" end="Slb1" again="1">
        <before>
            <tt_null/> <!-- instead close item -->
        </before>
        <after>
            <tt_null/>
        </after>
    </transition>
    And added the need closed item here:
            <transition start="Slb3" again="1">
                <before>
                    <tt_list>
                        <tt_element tag="ul" endtag="1"/>
                        <tt_string text="&#10;"/>
    <!-- Close upper tag not ended -->
    <tt_element tag="li" endtag="1"/>
    <tt_string text="&#10;"/>
                    </tt_list>
                </before>
                <after>
                    <tt_null/>
                </after>
            </transition>

    It seems to work but not sure in all cases (particulary with numbered list nested with bullet ones...)

     
    • Arne Jans

      Arne Jans - 2005-01-18

      There are transitions for the case of numbered lists nested with bullet ones. I dont remember which they are at the moment.

      Feel free to experiment with it.

       
    • Mark McAulay

      Mark McAulay - 2005-05-12

      Hi Arne, do you understand the transitions for bullet points?
      They didn't seem to be complete as instances of three-level bullet points would cause majix to hang. I was mapping custom bullet points to the standard bullet points in the .sty file.

      I have tried adding more transitions which has worked, but not in all cases.

      I don't understand what exactly the states mean in:
      _automaton.defineTransition(statelb1, statelb2, "lb1",RE + "<li><pa>", true, "</pa>" + RE, NOAGAIN, NOPUSH);
      _automaton.defineTransition(statelb1, statelb3, "lb2", RE + "<ul>" + RE, false, null, AGAIN, PUSH);

      Why only start the list when going from lb1 to lb3? Wouldn't you want to start the list when going from 1 to 2? or maybe statelb1 and statelb2 don't match exactly to the tags?
      Thanks,
      Mark.

       

Log in to post a comment.