Open bertfrees opened 9 years ago
Possible implementation of @counter-style support in Java (while formatting):
translate(int value, String style)
is called, the Translator applies the counter style named style
on the counter value value
(note that the Translator API must be enhanced).The alternative is to use a text-style
attribute (with number-format="default"
) and to perform the styling/formatting on the string (which represents an integer). This means that:
I can see two possibilities:
COUNTER[foo]
. The identifier foo
refers to a style defined within the Translator (like in initial proposal, see previous comment).@counter-style foo { ... }
could simply become @counter-style { ... }
, because the identifier foo
becomes obsolete when the style is applied directly on an element. Or we can be inspired by SASS and do it like counter-style: { system: ...; symbols: ... }
(which in SASS would actually be compiled down to counter-style-system: ...; counter-style-symbols: ...
).The problem with the second appoach is that while it looks like CSS it is not actually valid CSS so that may cause some confusion.
EDIT: In order to solve this problem I came up with the following:
text-transform
called -dotify-counter
-dotify-counter-style: { system: ...; symbols: ... }
== -dotify-counter-style-system: ...; -dotify-counter-style-symbols: ...
symbols()
function in XSLTsymbols()
function in Java (while formatting)@counter-style
incss:inline
@counter-style
in XSLT@counter-style
in Java (while formatting)Related issues: