Preceding list function

Subject: Preceding list function
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: 04 Aug 2000 16:49:51 -0400
I just found a bug in the DocBook stylesheets and I don't see an easy
way to fix it. But the structure of the error is such that I feel
there ought to be an easy way. Can anyone see what I'm missing?

DocBook allows lists to "continue" this means that:

  <orderedlist id="l1">
    <listitem>...</listitem>
    <listitem>...</listitem>
  <orderedlist>

  <orderedlist id="l2" continuation="continues">
    <listitem>...</listitem>
    <listitem>...</listitem>
  <orderedlist>

The first element of "l2" is numbered "3".

Note that this isn't just preceding siblings, though:

  <sect1>
    <sect2>
      <sect3>
        <orderedlist id="l3">
          <listitem>...</listitem>
          <listitem>...</listitem>
        <orderedlist>
      </sect3>
    </sect2>
  </sect1>

  <orderedlist id="l4" continuation="continues">
    <listitem>...</listitem>
    <listitem>...</listitem>
  <orderedlist>

The first element of "l4" is also "3".

*But*

  <sect1>
    <orderedlist id="l5"
      <listitem>
        <orderedlist id="l6">
          <listitem>...</listitem>
          <listitem>...</listitem>
          <listitem>...</listitem>
          <listitem>...</listitem>
        <orderedlist>
      </listitem>
    </orderedlist>
  </sect1>

  <orderedlist id="l7" continuation="continues">
    <listitem>...</listitem>
    <listitem>...</listitem>
  <orderedlist>

The first element of l7 is "2", not "5". My current algorithm gets 5.

The trick seems to be, how can I search for preceding elements in
order of end tag?

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@xxxxxxxxxx> | The art of living is more like
http://nwalsh.com/            | wrestling than dancing.--Marcus Aurelius


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread