Hi,

Hussein Shafie schrieb:

> Michael Huebner wrote:
>
>> I mean the name parameter in the original CSS counter (and counters ) 
>> mechanism (which hopefully may be adopted soon from XXE).
>> The counter in the CSS2 specification are more expressive than the 
>> proprietary solution in XXE.
>> For instance I need a combination of upper-letter for the highest 
>> level number and decimal numbers for all subordinate level numbers.
>
>
> The procedural semantics of CSS2 counters, which are indeed more 
> powerful than our proprietary, declarative, solution, are not well 
> adapted to an XML editor.
>
> CSS2 counters have been designed with browsers in mind. In fact the 
> whole CSS2 spec has been designed with browsers in mind; that's why 
> proprietary extensions were absolutely required.
>
> Implementing CSS2 counters would mean making XXE even slower than it 
> already is. This is unlikely to happen before several months.

I can get the counters that I need with the existing non-precedural (or 
"declarative") counter mechanism.
This requires a little extra work because for every (up to a maximal) 
nesting level I have to specify a counter with appropriate CSS parent 
selectors.
To get different numbering formats (upper-latin and decimal) I use two 
counters. The "major" counter uses "-" to skip the minor elements.

Example:
chapter:before {
    content: counter(n, upper-latin);
}

section:before {
    content: counter(n-, upper-latin) "." counter(n, decimal);
}

section > section:before {
    content: counter(n--, upper-latin) "." counter(nn, decimal);
}

section > section > section:before {
    content: counter(n---, upper-latin) "." counter(nnn, decimal);
}

Btw. the intended solution with CSS2.0 procedural counters would not 
work for me!

Citation from the CCS2.0 standard:


      12.5.1 Nested counters and scope

"The self-nesting is based on the principle that every element that has 
a 'counter-reset' 
<http://www.w3.org/TR/REC-CSS2/generate.html#propdef-counter-reset> for 
a counter X, creates a fresh counter X, the scope of which is the 
element, its preceding siblings, and all the descendants of the element 
and its preceding siblings."

Problem:
This specification of the counter scope makes it difficult to use 
"counters" for directly nested elements.

Example:
section:before {
    content: counter(section-number);
    counter-increment: section-number;
}

The counter of nested section elements has yet to be reset, but
    counter-reset: section-number;
would not work because it would also effect the counter in the element 
itself.

So non-procedural counters are fine for me!

The problem that remains is:
1) In the elements that reference (have an IDREF attribute pointing to) 
a section, I need to display the number of the section.
2) Up to now even regular attributes of the target element can not be 
displayed on the referring site.
My point is: when you make a decision to support 2) it would be great if 
you could handle 1) in a similiar way.
This could be achieved by handling counters as (pseudo) attributes of 
the referred element. But how can a counter be referred to, if it has no 
name?

That's why I vote for a mean of identifying counters.
 
My favorit approach is to use "counters()" instead of "counter()", using 
its name-parameter for the identification and to allow the style-parameter
to have values not defined by the CSS2 specification.
To allow different formating styles on different levels, the 
style-parameter could contain a format string mad of the following 
characters for every element level
- = ignore
d = decimal
a/A = lower-/upper-alpha
l/L = lower-/upper-latin
r/R = lower-/upper-roman

Example:
section > section > section:before {
    content: counters(section-number, ".", "Lddd");
}

May be to stress the difference to the CSS specification, instead of the 
name "counters" a proprietary name could be used, e.g. "index", 
"numbering" or so.
 

-- 
Best regards
Michael H?bner


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20031215/6ac177da/attachment.htm
 

Reply via email to