{"word_count": 445, "character_count": 3668}
Attribute classes have been introduced in the TEI infrastructure in order to declare groups of attributes which are shared across various elements. For instance, the att.timed attribute class contains the declaration of two attributes, @start and @end (see https://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-att.timed.html): the elements whose specification states that they belong to this class will automatically get the two attributes. This is reflected in the generated documentation, as can be seen for the &#60;u&#62; element for instance (see https://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-u.html).Over the years, it has been a general policy of the TEI technical council to factorise attribute declarations as classes in order to simplify the legibility and management of the guidelines.When designing a TEI customisation in ODD, it is possible to use attribute classes to make the corresponding attributes available for additional elements. For example, you may want to say that there are several types of formulas in your document model and thus add the &#60;formula&#62; element to the att.typed attribute class.In ODD specifications, adding an element to an attribute class can be achieved as exemplified below:&#60;elementSpec ident="formula" mode="change"&#62;   &#60;classes mode="change"&#62;      &#60;memberOf key="att.typed" mode="add"/&#62;   &#60;/classes&#62;&#60;/elementSpec&#62;The preceding declaration supplies the &#60;formula&#62; element with the two attributes declared in att.typed (see https://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-att.typed.html), namely @type and @subtype.Conversely, one may want to get rid of some attributes inherited through a class on a specific element. There are actually two ways to do so:Completely deselect the attribute class from the element, which takes out all attributes that were declared in the class;Operates a surgical change by just taking out the intended attributes from the element.The first method is similar to adding an attribute class to an element with the @mode attribute set to “delete” on &#60;memberOf&#62;. The following example removes the &#60;s&#62; element from the att.typed attribute class, thus depriving it of both @type and @subtype:&#60;elementSpec ident="s" mode="change"&#62;   &#60;classes mode="change"&#62;      &#60;memberOf key="att.typed" mode="delete"/&#62;   &#60;/classes&#62;&#60;/elementSpec&#62;The second methods elicits the deletion of the attribute from the element by using an &#60;attDef&#62; declaration. The following snippet deletes the @subtype attribute from the &#60;s&#62; element while keeping @type inherited from att.typed.&#60;elementSpec ident="s" mode="change"&#62;   &#60;attList&#62;      &#60;attDef ident="subtype" mode="delete"/&#62;   &#60;/attList&#62;&#60;/elementSpec&#62;In some situations, when just one attribute from a class is needed, it is possible to combine a class attribution and attribute deletion declarations within the same ODD specification. For instance the following declaring makes &#60;u&#62; member of att.typed, while deleting @subtype:&#60;elementSpec ident="formula" mode="change"&#62;   &#60;classes mode="change"&#62;      &#60;memberOf key="att.typed" mode="add"/&#62;   &#60;/classes&#62;   &#60;attList&#62;      &#60;attDef ident="subtype" mode="delete"/&#62;   &#60;/attList&#62;&#60;/elementSpec&#62;Note: such a customization is closer to the spirit of the TEI guidelines, than declaring a new @type attribute on the element.In the same way, it is possible to change the actual declaration of an attribute, in order to associate, for instance, a closed set of values to it.