arc:set

Version 20.0.7488


arc:set

Version 20.0.7488


The arc:set keyword sets a value in an attribute. If an attribute is set in an item that does not exist, the item is automatically created.

There are two ways to set a value using arc:set. You can set the value parameter or, for large values that are multiline and complex, you can set the value using the scope of the keyword itself.

Parameters

  • item: The item parameter is used to specify the item in which the attribute is set. Specifying an item is not required. If an item is not specified, the default item is used.
  • attr: The name of the attribute. You can also specify the item using the dot notation (e.g., item.prefix:attr). Note that a complete attribute name has both a prefix and an attribute name, but the prefix is not required.
  • value: The value to be assigned to the attribute. If this parameter is not provided, the entire body of the arc:set keyword is used as the value. This is convenient for setting long or multiline values.
  • copyfrom: The attributes from the item specified in this parameter are copied to the item specified by the item parameter.

Control Attributes

None

Examples

Use the scope of the keyword to set a value to the message attribute of the item named “input”:

<arc:set item="input" attr="message">
  Dear [name],
  You have won a cruise trip to Hawaii.
  Please confirm your acceptance by [date].
  Thanks, [sales]
</arc:set>

See Also

  • arc:unset: Remove an attribute from an item.
  • arc:setm: Set multiple attributes with only one keyword.