Hi there,
maybe someone can point me to the right direction with this. When editing
DocBook, I want <co> elements to appear styled with an icon. Clicking this
icon copies the <co>'s id attribute to the clipboard, so that I can paste it
to a <callout>'s arearefs.
As I could only find commands like putAttribute and addAttribute but nothing
like getAttribute, I tried to hack something myself. The command in [2]
seems to succesfully copy the value of id (I checked it with the alert
command instead of copy).
The problem with the copy command is that not only the id is copied to the
clipboard, but also loads of other tags [3].
The question is: Does XXE offer a simple way to get an attribute value? And
if not, is it possible to make my command work?
Thanks for helping and sorry for the lengthy mail ...
Patrick
[1] css
co[id]:after {
content: command-button(icon, icon(right-target),
command, "getAtt"
);
}
[2] command "getAtt"
<command name="getAtt">
<macro>
<sequence>
<command name="selectNode" parameter="self co" />
<match context="$selected" pattern="co" />
<set variable="attval" context="$selected" expression="@id" />
<get expression="$attval" plainString="true" />
<command name="copy" parameter="%_" />
</sequence>
</macro>
</command>
[3] clipboard content
<?xml version="1.0"?>
<ns:clipboard
xmlns:ns="http://www.xmlmind.com/xmleditor/namespace/clipboard"
><co
id="abcdef"
></co
></ns:clipboard
>
--
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum superg?nstigen Komplett-Preis!