Parameter syntax:
[ '[implicitElement]' ]? [ '[empty]'|'[dummy]'|'[default]'|'[id]' ]? [ '[simplePrompt]'|'[normalDialog]' ]?attribute_name
[attribute_value
]?
Adds or replaces attribute attribute_name
in explicitly or implicitly selected element if the grammar constraining the document allows to do so.
If attribute value attribute_value
is specified then this value is used as the new value of attribute attribute_name
(this value is checked for validity).
Note that an attribute value containing whitespace must be quoted using single or double quotes. See alt
example below.
For obvious reasons, attribute value attribute_value
must not be specified when any of option [empty]
, [dummy]
or [id]
is used.
Otherwise
If [empty]
has been specified, sets the attribute to the empty string (without checking if it is a valid value).
If [dummy]
has been specified, sets the attribute to string "???
" (without checking if it is a valid value).
If [default]
has been specified, sets the attribute to its default value if any and to string "???
" otherwise (without checking if it is a valid value).
If [id]
has been specified, sets the attribute to an automatically generated id (without checking if it is a valid value).
Otherwise, a dialog box is displayed to let user interactively specify a value (this value is checked for validity).
This dialog box simply contains a text field if option [simplePrompt]
has been specified.
By default or if option [normalDialog]
has been specified, this dialog box may contain a more advanced editor, which is specific to the type of the attribute being edited.
Note that this “normal dialog box” automatically makes use of custom attribute editors defined by the means of the attributeEditor
configuration element in XMLmind XML Editor - Configuration and Deployment.
Examples:
putAttribute cols
putAttribute alt "XMLmind logo"
putAttribute [implicitElement] cols
putAttribute [dummy] cols
putAttribute [implicitElement] [id] xml:id
putAttribute [simplePrompt] href
putAttribute [implicitElement] [simplePrompt] href
See also editAttribute
and addAttribute
.