View Categories

set-attribute

2 min read

Table of Contents

Attribute annotations are used to manipulate attributes in your document.

Syntax #

element-identifier(IDENTIFIER)
element-identifier-lowercase(IDENTIFIER)
element-identifier-lowercase-alphanumeric(IDENTIFIER)
element-identifier-alphanumeric(IDENTIFIER)
remove-attribute(ATTRIBUTE-NAME)
set-attribute(ATTRIBUTE-NAME=ATTRIBUTE-VALUE)
set-attribute-on(ELEMENT-NAME;ATTRIBUTE-NAME=ATTRIBUTE-VALUE)

IDENTIFIER

The value which the ID attribute will be set to.

ATTRIBUTE-NAME

The name of an attribute whose value will be set.

ATTRIBUTE-VALUE

The value to which an attribute will be set.

ELEMENT-NAME

The name of the element on which the attribute will be set.

Description #

The element-identifier annotation is used to set the ID attribute of the element to which it is applied. The value to which the ID attribute should be set must be provided as an argument to the annotation. Even though the set-attribute can be used for this purpose in certain contexts, it is preferable to use the element-identifier annotation since this annotation is capable of formating values to conform to the required format of the ID attribute.

The remove-attribute annotation is used to remove attributes from the element to which it is applied. The name of the attribute which should be removed from the element must be provided as an argument to the annotation.

The set-attribute annotation is used to set the ID attribute of the element to which it is applied. The name of the attribute which should be set as well as the value to which it should be set must be provided as arguments to the annotation.

The elements which are visible in the Rules Editor are converted by Migrate into valid XML elements. However in order to generate valid XML, Migrate must also create other elements. The set-attribute-on annotation is used to set attributes on those elements which are created implicitly by Migrate. An example of this is the p.title.concept annotation. The paragraph to which this annotation is applied is converted into the title of a concept and the concept element is created by Migrate. The set-attribute-on annotation can be used to set an attribute on the concept element.