<attDef>

<attDef> (définition d'attribut) contient la définition d'un attribut. [23.5.3 Attribute List Specification]
Module tagdocs — Documentation Elements
Attributs
usage⚓︎ précise qu'un attribut ou un élément sont facultatifs.
Statut Optionel
Type de données teidata.enumerated
Les valeurs autorisées sont:
req
(requis)
rec
(recommandé)
opt
(facultatif) [Valeur par défaut]
Contenu dans
tagdocs: attList
Peut contenir
Exemple
<attDef usage="recident="type">
 <desc>spécifie un nom conventionnellement utilisé pour ce niveau de divisions , par ex.
 <val>acte</val>, <val>volume</val>, <val>livre</val>, <val>section</val>,
 <val>chant</val>, etc.</desc>
 <datatype>
  <dataRef key="teidata.word"/>
 </datatype>
</attDef>
Schematron

<sch:ns prefix="teix"
 uri="http://www.tei-c.org/ns/Examples"/>

<sch:rule context="tei:attDef">
<sch:assert test="ancestor::teix:egXML[ @valid eq 'feasible'] or @mode eq 'change' or @mode eq 'delete' or tei:datatype or tei:valList[ @type eq 'closed']"> Attribute: the definition of the @<sch:value-of select="@ident"/> attribute in the
<sch:value-of select="ancestor::*[@ident][1]/@ident"/>
 <sch:value-of select="' '"/>
 <sch:value-of select="local-name(ancestor::*[@ident][1])"/> should
have a closed valList or a datatype
</sch:assert>
</sch:rule>
Schematron

<sch:rule context="tei:attDef[@usage eq 'req']">
<sch:report test="tei:defaultVal">Since the @<sch:value-of select="@ident"/> attribute is required, it will always be specified. Thus the default value (of "<sch:value-of select="normalize-space(tei:defaultVal)"/>") will never be used. Either change the definition of the attribute so it is not required ("rec" or "opt"), or remove the defaultVal element.</sch:report>
</sch:rule>
Schematron

<sch:rule context="tei:attDef[ tei:defaultVal and tei:valList[ @type eq 'closed'] and tei:datatype[ @maxOccurs > 1 or @minOccurs > 1 or @maxOccurs eq 'unbounded'] ]">
<sch:assert test="tokenize(normalize-space(tei:defaultVal),' ') = tei:valList/tei:valItem/@ident">In the <sch:value-of select="local-name(ancestor::*[@ident][1])"/> defining
<sch:value-of select="ancestor::*[@ident][1]/@ident"/> the default value of the
@<sch:value-of select="@ident"/> attribute is not among the closed list of possible
values</sch:assert>
</sch:rule>
Schematron

<sch:rule context="tei:attDef[ tei:defaultVal and tei:valList[ @type eq 'closed'] and tei:datatype[ not(@maxOccurs) or ( if ( @maxOccurs castable as xs:integer ) then ( @maxOccurs cast as xs:integer eq 1 ) else false() ) ] ]">
<sch:assert test="string(tei:defaultVal) = tei:valList/tei:valItem/@ident">In the <sch:value-of select="local-name(ancestor::*[@ident][1])"/> defining
<sch:value-of select="ancestor::*[@ident][1]/@ident"/> the default value of the
@<sch:value-of select="@ident"/> attribute is not among the closed list of possible
values</sch:assert>
</sch:rule>
Modèle de contenu
<content>
 <sequence>
  <alternate minOccurs="0"
   maxOccurs="unbounded">

   <classRef key="model.identSynonyms"/>
   <classRef key="model.descLike"/>
  </alternate>
  <elementRef key="datatypeminOccurs="0"/>
  <elementRef key="constraintSpec"
   minOccurs="0maxOccurs="unbounded"/>

  <elementRef key="defaultVal"
   minOccurs="0"/>

  <alternate minOccurs="0">
   <elementRef key="valList"/>
   <elementRef key="valDescminOccurs="1"
    maxOccurs="unbounded"/>

  </alternate>
  <elementRef key="exemplumminOccurs="0"
   maxOccurs="unbounded"/>

  <elementRef key="remarksminOccurs="0"
   maxOccurs="unbounded"/>

 </sequence>
</content>
Schéma Declaration
<rng:element name="attDef">
 <rng:ref name="att.global.attributes"/>
 <rng:ref name="att.global.rendition.attributes"/>
 <rng:ref name="att.global.linking.attributes"/>
 <rng:ref name="att.global.analytic.attributes"/>
 <rng:ref name="att.global.facs.attributes"/>
 <rng:ref name="att.global.change.attributes"/>
 <rng:ref name="att.global.responsibility.attributes"/>
 <rng:ref name="att.global.source.attributes"/>
 <rng:ref name="att.identified.attributes"/>
 <rng:ref name="att.combinable.attributes"/>
 <rng:ref name="att.deprecated.attributes"/>
 <rng:ref name="att.namespaceable.attributes"/>
 <rng:optional>
  <rng:attribute name="usage"
   a:defaultValue="opt">

   <rng:choice>
    <rng:value>req</rng:value>
    <rng:value>rec</rng:value>
    <rng:value>opt</rng:value>
   </rng:choice>
  </rng:attribute>
 </rng:optional>
 <rng:group>
  <rng:zeroOrMore>
   <rng:choice>
    <rng:ref name="model.identSynonyms"/>
    <rng:ref name="model.descLike"/>
   </rng:choice>
  </rng:zeroOrMore>
  <rng:optional>
   <rng:ref name="datatype"/>
  </rng:optional>
  <rng:zeroOrMore>
   <rng:ref name="constraintSpec"/>
  </rng:zeroOrMore>
  <rng:optional>
   <rng:ref name="defaultVal"/>
  </rng:optional>
  <rng:optional>
   <rng:choice>
    <rng:ref name="valList"/>
    <rng:oneOrMore>
     <rng:ref name="valDesc"/>
    </rng:oneOrMore>
   </rng:choice>
  </rng:optional>
  <rng:zeroOrMore>
   <rng:ref name="exemplum"/>
  </rng:zeroOrMore>
  <rng:zeroOrMore>
   <rng:ref name="remarks"/>
  </rng:zeroOrMore>
 </rng:group>
</rng:element>
element attDef
{
   att.global.attributes,
   att.global.rendition.attributes,
   att.global.linking.attributes,
   att.global.analytic.attributes,
   att.global.facs.attributes,
   att.global.change.attributes,
   att.global.responsibility.attributes,
   att.global.source.attributes,
   att.identified.attributes,
   att.combinable.attributes,
   att.deprecated.attributes,
   att.namespaceable.attributes,
   attribute usage { "req" | "rec" | "opt" }?,
   (
      ( model.identSynonyms | model.descLike )*,
      datatype?,
      constraintSpec*,
      defaultVal?,
      ( valList | valDesc+ )?,
      exemplum*,
      remarks*
   )
}