Re: [docbook-apps] OrderedList and 'continuation' attribute

From
Ioward Oerrin
Date
2011-06-10T11:47:30+00:00
ID
BANLkTi=
Thread
Re: [docbook-apps] OrderedList and 'continuation' attribute
Bob,

Thanks very much for your help. That seems to fix the problem - I've raised a bug on sourceforge as requested (https://sourceforge.net/tracker/?func=detail&aid=3314663&group_id=21935&atid=373747).

I've noticed though with your fix that if 'continuation=continues' is used on a nested ordered list, and there is not another ordered list at the same level as the current one, but there is a nested list at the same level in a previous ordered list, then the numbering from that is picked up. This, to my mind, is not really desired behaviour - what do you think? (I hope that makes sense, if not I'll send through an example!)

Howard

On 9 June 2011 16:55, Bob Stayton <> wrote:

Hi Howard,

I think that is a bug, since the results are simply 
wrong.  The numbering should continue from the same list nesting level, in 
my opinion.  Could you please file a bug report on the DocBook SourceForge 
site for this?

 

To fix it, take a look at the template named 
'output-orderedlist-starting-number' in common/common.xsl.  In there you 
will see in the "otherwise" case that:

 

<xsl:variable name="prevlist" 
select="$list/preceding::orderedlist[1]"/>

 

This selects the previous list regardless of level, 
which in your instance is the nested list.  I think this selection should 
be of the preceding list with the same number of orderedlist ancestors, 
something like this [untested]:

 

<xsl:variable name="prevlist" 
select="$list/preceding::orderedlist[count($list/ancestor::orderedlist) = 
count(ancestor::orderedlist)][1]"/>

 

If DocBook 5, don't forget to add the namespace 
prefix.

 

Bob Stayton
Sagehill Enterprises


 

 

  
----- Original Message ----- 

  
From: 
  Howard 
  Perrin 

  
To:  
  

  

Sent: Thursday, June 09, 2011 1:50 
  AM

  
Subject: [docbook-apps] OrderedList and 
  'continuation' attribute

  

Hi,
  

  
I'm having a problem with the 'continuation' attribute on 
  <orderedlist> elements. When I set it to 'continues' and the list 
  follows a nested list, the numbering is started from the nested list 
  rather than the outer list. For example, if I have:

  

  
<orderedlist>
  <listitem><para>First 
  Item</para></listitem>
  
  <listitem><para>Second 
  Item</para></listitem>
  
  <listitem><para>Third Item</para>
  
                
   <orderedlist>
            
         <listitem><para>Nested First 
  Item</para></listitem>

  
                   
  <listitem><para>Nested Second 
  Item</para></listitem>
          
          
   <listitem><para>Nested Third Item</para>
  
                  
   <listitem><para>Nested Fourth Item</para>

  
                  
   <listitem><para>Nested Fifth Item</para>

  
                
   </orderedlist>

  
  </listitem>

  
</orderedlist>

  

  
<orderedlist continuation='continues'>
  
  <listitem><para>Fourth Item</para></listitem>
  
  <listitem><para>Fifth 
  Item</para></listitem>

  

  
</orderedlist>

  

  
When transformed using the docbook XSL via FO to PDF the output looks 
  like:

  

  
1. First Item

  
2. Second Item

  
3. Third Item
    a. Nested First Item
    
  b. Nested Second Item
  
    c. Nested Third Item
    d. Nested Fourth 
  Item
  
    e. Nested Fifth Item

  
6. Fourth Item

  
7. Fifth Item

  

  
Maybe this is intended behaviour - but I want to have 6 & 7 actually 
  numbered 4 & 5 so that they continue the numbering from the list at the 
  same level. Does anyone know if/how I can add something to my customisation 
  layer to change the behaviour here?

  

  
Thanks!

  
Howard