api:setc

Version 23.0.9145


api:setc


Use the api:setc keyword to add static text without escaping special characters, such as square brackets ([ ]), in APIScript. While special characters can already be escaped with a backslash, this keyword provides a shortcut. For example, you can use it to easily set an XPath.

Parameters

  • item: The item in which to set the attribute.
  • attr: The attribute name.
  • value: The value to assign to the attribute. If this parameter is not provided, the entire body of api:setc is used as the value. This is convenient for setting long or multi-line 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

Set an unescaped XPath:

<api:setc attr="xpath" value="/root/book[1]/@name" />