Dear both,

On Thursday 18 December 2008 21:34:45 Richard Hamilton wrote:
> There may be a better way to do this that someone can suggest,
[...]

I think counting the number of siblings should allow the output to be order 
independent.  The (untested!) condition for chapter 3 would be:
        <when test="count(preceding-sibling::chapter) = 2">

If you don't like the zero-offset, then:
        <when test="count(preceding-sibling::chapter | self::chapter) = 3">

However, maybe there's a better way.  If the colour represents some aspect of 
the chapters (introduction, topic-A, topic-B, etc..) rather than their 
structural position (like with Zebra tables) then it might be better to mark 
this within the DocBook (e.g., adding a custom role for the chapter) and base 
the markup on the chapter's role, rather than hard-coding the chapter numbers 
within your XSLT customisation layer.  This would give you flexibility to 
reorder the chapters, add new chapters, etc without having to alter your 
stylesheets.

HTH,

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to