<attDef>
<attDef> (attribute definition) contains the definition of a single attribute. [22.5.3 Attribute List Specification] | |||||||||
Modul | tagdocs — Documentation Elements | ||||||||
Attribute |
|
||||||||
Enthalten in |
tagdocs: attList
|
||||||||
Kann enthalten | |||||||||
Beispiel |
<attDef usage="rec" ident="type">
<desc>specifies a name conventionally used for this level of subdivision, e.g. <val>act</val>, <val>volume</val>, <val>book</val>, <val>section</val>, <val>canto</val>, etc.</desc> <datatype> <dataRef key="teidata.word"/> </datatype> </attDef> |
||||||||
Schematron |
<sch:ns prefix="teix" uri="http://www.tei-c.org/ns/Examples"/> <sch:assert test="ancestor::teix:egXML[@valid='feasible'] or @mode eq 'change' or @mode eq 'delete' or tei:datatype or tei:valList[@type='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> |
||||||||
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 = '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> |
||||||||
Content model |
<content> |
||||||||
Schema Deklaration |
<rng:element name="attDef"> 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* ) } |