Step eval-counter {http://www.daisy.org/ns/pipeline/braille-css}

Evaluate counter() and target-counter() values according to http://braillespecs.github.io/braille-css/#h4_printing-counters-the-counter-function and http://braillespecs.github.io/braille-css/#h4_the-target-counter-function.

Defined in: http://www.daisy.org/pipeline/modules/braille/css-utils/library.xpl

Input Ports

Port Description
source primary sequence

counter() and target-counter() values in the input must be represented by css:counter elements. The 'counter-set', 'counter-reset' and 'counter-increment' properties of elements must be declared in css:counter-set, css:counter-reset and css:counter-increment attributes and must conform to http://braillespecs.github.io/braille-css/#h4_manipulating-counters-the-counter-increment-counter-set-and-counter-reset-properties. Elements that are referenced by a target-counter() value must be indicated with a css:id attribute that matches the css:counter element's target attribute. If a document in the input sequence represents a named flow this must be indicated with a css:flow attribute on the document element.

Output Ports

Port Description
result primary sequence

For each css:counter element whose counter name is specified in the 'counters' option, or not specified in the 'exclude-counters' option if the 'counters' option is '#all', the counter value is computed and the counter representation for that value and the specified counter style is wrapped in an inline css:box element and inserted in place of the css:counter element. The css:box element has a css:text-transform attribute that represents the 'text-transform' descriptor of the counter style (default 'auto'). If the css:counter element represents a target-counter() value, the css:box element has a css:anchor attribute with the target ID.

Options

Local Name Namespace URI Default Description
counters '#all'

The 'counters' option must be a space separated list of counter names, or the word '#all'.

exclude-counters ''

The 'exclude-counters' option must be a space separated list of counter names, or the empty string. The option is ignored if the 'counters' option is also specified (and has a value other than '#all').

counter-styles map{}

The 'counter-styles' option must be a map from counter style names to counter style definitions represented by css:counter-style elements.