setting counter values without opening a scope..

Hello CSS counter folks.


Currently setting a css counter to a defined value is only possible using the 'counter-reset' property.
However counter-reset has the sometimes undesired habit of forcing a new scope (which is great for nesting counters but disturbing for e.g. chapter counting).

Therefore our question/suggestion:

Is it/should it be possible to decouple the two abilities to 1) setting a property to a defined value and 2) opening a new counter scope?

The use case is the following:

In print, one sometimes like to have number all the pages of a chapter and restart numbering if a new chapter starts.
This is e.g. required in documents of the FDA conforming to their specification found at http://www.fda.gov/cber/gdlns/m4ctdannex.htm or in documents for the European commission.

I.e. I'd expect something like the following to be possible:

chapter {
   page-break-before: always;
   counter-reset: chapterPageCounter 1;
   string-set: chapterName self;
}

@page {
   counter-increment: chapterPageCounter;
   @bottom-right {
      Content: "Page " counter(chapterPageCounter) "of section " open-quote string(chapterName) close-quote;
   }
}

However due to the fact that counter-reset opens a new scope, this will not lead the desired result because the relation of page margins content to scopes is a) unspecified and b) unexpected.

What is missing here is the ability to set a counter to a start value inside a scope without opening the new scope for the counter.

Something like e.g:

chapter {
    counter-set: chapterPageCounter 1;
}

Maybe the folks have better suggestions how this could/should be done?

I tried to evaluate other mechanisms to achieve this but did not find other solutions, also not in the gcpm module.

Maybe I missed something...


Best regards,

Ludger Bünger

-- 
Dipl.-Inf. Ludger Bünger
Senior Software Developer
Team PDFreactor
- - - - - - - - - - - - - - - -
RealObjects GmbH
Altenkesseler Str. 17/B4
66115 Saarbrücken, Germany
Tel +49 (0)681 98579 0
Fax +49 (0)681 98579 29
http://www.realobjects.com
ludger.buenger@realobjects.com
- - - - - - - - - - - - - - - -
Commercial Register: Amtsgericht Saarbrücken, HRB 12016
Managing Directors: Michael Jung, Markus Neurohr
VAT-ID: DE210373115

Received on Thursday, 24 July 2008 10:55:55 UTC