Restricting an Element’s Attributes to Specific Ones Only
By default in TEI, elements inherit many attribute classes (att.global, att.datable, etc.), making numerous attributes available. If you want to allow only specific attributes, configure it as follows.
Example: Allowing Only xml:id and corresp on persName
Key Points
- Use
<classes mode="change">: If you usemode="replace"and leave it empty, the model classes will also be deleted, making the element itself unusable - Delete attribute classes individually: Remove unnecessary attribute classes with
<memberOf key="att.xxx" mode="delete"/> - Add required attributes: Define the attributes you want to allow with
<attDef ident="xxx" mode="add">
Notes
- You can check which attribute classes an element belongs to in the TEI Guidelines
- Deleting
att.globalwill also removexml:id,xml:lang, etc., so add them individually as needed
Adding Attributes to an Element
When adding a new attribute while keeping existing attribute classes:
In this case, the existing attribute classes are maintained as-is, and the facs attribute is added.