Ute.Dieckmann at bertelsmann.de wrote:
> p:before{
>     display: marker;
>     content: counter(n) ". Absatz: (" xpath("string-length(.)") ")";
>     font-weight: bold;
>     color: #0000A0;
> }
> 
> The number of characters is displayed in the editor after a rebuild. My 
> question: Is there a possibility to display this number of characters 
> continually during the process of editing (without the need to extend XXE by 
> using a Java API)?

Replace:

xpath("string-length(.)")

by:

label(xpath, "string-length(.)")

and the generated content will *automatically refresh itself*, though
not in realtime, but instead, when ``the editing context changes''.

The editing context changes each time a node is selected and each time
the caret is moved from a text node to another. That is, very very often.

This is not ideally what you want, but this solution is simple and
relatively efficient.

---
PS: The label should also automatically refresh itself each time the
document is about to be saved, checked for spelling, checked for
validity, etc. Unfortunately, this behavior has been omitted. This is
fixed now, but you'll have to wait next release to get that.



Reply via email to