This command is similar to putAttribute
except that it returns the attribute value as a string instead of setting the attribute on the selected element. This command is only useful to write macro commands.
Macro command example: set attribute style
, but when the value chosen by the user is the empty string, remove attribute style
(if any):
<command name="setStyle"> <macro> <sequence> <command name="editAttribute" parameter="[implicitElement] style" /> <set variable="style" expression="%_" plainString="true" /> <choice> <sequence> <test expression="not($style)" /> <command name="removeAttribute" parameter="[implicitElement] style" /> </sequence> <sequence> <get expression="replace($style, "'", "\\'", l)" /> <command name="putAttribute" parameter="[implicitElement] style '%_'" /> </sequence> </choice> </sequence> </macro> </command>
Escape single quote characters " | |
The value of attribute |