Michael Huebner wrote:
> 
> One problem:
> Now I tried to display the concatenation of the values of attributes. I 
> wrote in my css-file:
>     set-attribute-button(attribute, user, text, 
> xpath("id(@relation-role)/concat(@name, ' ', @id)"))
> but on opening the xml-file I got an error
>     .../ucx.css:277:124: not supported value for property "content":
>     cannot parse XPath expression "id(@object)/concat(@name, ' ', @id)": 
> expected node test
> 
> How can I get the concatenation of the values of attributes?

The XPath expression is really invalid. You need to rewrite it as follows:

---
set-attribute-button(
   attribute, user,
   text, xpath("concat(id(@relation-role)/@name,
                       ' ',id(@relation-role)/@id)"))
---



> 
> Another problem:
> I don't know how I can use xpath to filter the elements to be displayed 
> in the selection dialog of a "set-attribute-button()".
> 
> (B.t.w. the documentation page for "set-attribute-button()" in 
> docs/csssupport/ch05s26.html is very short and has only the example:
> 
> set-attribute-button(attribute, for,
>                      unset-attribute, yes,
>                      icon, icon(pop-right));
> 
> for the general syntax:
> 
> *set-attribute-button*(*attribute*, /attribute_name/, /key/, /value,/ 
> ..., /key/, /value/)
> 
> I think that it would be good to provide on this documentation page an 
> example for the existing keys "text" and "color", too.)
> 
> My proposal is to add a key "selection" where the value is an xpath 
> expression that denotes the elements that can be selected, e.g. 
> "//person" to select all elements of type "person".
> The default value would be "//*".
> 
> My proposal is also to add a key "list-item-display" where the value is 
> a string (constructed from xpath expressions) that describes the 
> appearance of the items in the selection list. E.g. if the "selection" 
> key is set to ""//person", the "list-item-display" could be 
> 
> "concat(@firstname, ' ', @lastname)"
> 
> 
> The default value for  "list-item-display" would be the attribute that 
> is of type ID in the referenced element.
> 
> If elements of different types (e.g. person and group) should be 
> selectable, this could be achieved by having multiple entries of the 
> keys, e.g.
> 
> set-attribute-button(attribute, user, 
>       selection, "//person", 
>       list-item-display, "concat(@firstname,  ' ',  @lastname)",
>       selection, "//group",
>       list-item-display, "@name")
> 
> Or is there already a way to achieve the desired behavior?

Sorry but there is no way to do this without programming in Java.

You need to code a CSS style extension in Java -- see 
http://www.xmlmind.com/xmleditor/_distrib/docs/dev/ar01s07.html#solution4 
-- in order to get exactly what you want.


Reply via email to