OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] preceding-sibling::chapter[nummer]

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 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]