Alexander Dupuy wrote:
>
> I would like to have a convert button which has a text that is the
> element name; this way, users clicking on the name are offered a list of
> alternative names, e.g.
>
> *:before {
> content: division(
> content(
> paragraph(
> content(collapser(collapsed-icon, icon(pop-right),
> expanded-icon, icon(pop-down)), " ",
> convert-button(text, element-name()), " ",
> replace-button(), " ",
> insert-before-button(), " ",
> insert-button(), " ",
> insert-after-button(), " ",
> delete-button(), " ",
> add-attribute-button(check-has-attributes, yes,
> color, navy)),
> background-color, silver,
> padding-left, 4),
> attributes(margin-top, 2,
> margin-bottom, 2,
> margin-left, 2,
> margin-right, 2)));
> }
>
> Unfortunately, element-name() appears to have no value in this context.
> I can set up specific rules for each element, with the name as a fixed
> string, but this requires a lot of duplication.
OK. We'll fix this.
> Another glitch is that a command-button which inserts an element with a
> required enumerated attribute creates the element with the attribute
> value as "???" but the combobox item simply displays the first menu
> choice (in red). This can be a bit confusing, because you can't see the
> "???" that the validation error refers to.
Well, it is not very difficult to guess: the red color means that there
is a problem here. But see also my answer below.
> Is there any way to specify
> the attribute value for a newly inserted element in the css?
No. For now, adding an attribute by picking an attribute name from a
list is a 2-step process:
[1] Choose the attribute name from a list.
[2] Replace "???" by an actual value.
I agree that this is no very intuitive but it is quick and simple to use
once you've learned it.
There is a way to do what you want: specify a command-button displaying
a menu of putAttribute commands. putAttribute allows you to specify both
the attribute name and the attribute value. See
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s05s27.html
> Or at least have the generated combobox special-case the value "???" and
> display it? (It would be useful if the combobox displayed any current
> value of the attribute, but even just "???" would help a lot).
OK. We'll improve this.
> Finally, is there any way to specify the initial state of a collapser?
Not in the collapser() pseudo-function itself. Use CSS property:
collapsed:yes;. See
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s06s03.html#collapsibleblocks
> Or to collapse/expand all elements?
In the CSS no. Interactively, yes: right click on the arrow of a
collapser and it will display an ``Expand All/Collapse All'' menu, just
like in the tree view.