<constraintSpec>
<constraintSpec> (constraint on schema) contains a constraint, expressed in some formal syntax, which cannot be expressed in the structural content model [22.4.4 Element Specifications] | |||||||||
Módulo | tagdocs — 22 Documentation Elements | ||||||||
Atributos | att.global (@xml:id, @n, @xml:lang, @rend, @rendition, @xml:base, @xml:space) (att.global.linking (@corresp, @synch, @sameAs, @copyOf, @next, @prev, @exclude, @select)) (att.global.analytic (@ana)) (att.global.facs (@facs)) (att.global.change (@change)) att.identified (@ident, @predeclare, @module, @status) (att.combinable (@mode)) att.typed (@type, @subtype)
| ||||||||
Usado por | |||||||||
Contenido en | tagdocs: attDef classSpec elementSpec macroSpec schemaSpec | ||||||||
Puede contener | |||||||||
Declaración |
element constraintSpec { att.global.attributes, att.global.linking.attributes, att.global.analytic.attributes, att.global.facs.attributes, att.global.change.attributes, att.identified.attributes, att.combinable.attributes, att.typed.attributes, attribute scheme { "schematron" | "isoschematron" | "xsl" | "private" }, model.glossLike*, constraint? } | ||||||||
Schematron | Relationship between scheme attribute and contents <sch:ns prefix="s" uri="http://www.ascc.net/xml/schematron"/> <sch:report test="tei:constraint/s:* and not(@scheme='schematron')">Rules in the Schematron 1.* language must be inside a constraint with a value of 'schematron' on the scheme attribute </sch:report> | ||||||||
Schematron | <sch:ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/> <sch:report test="tei:constraint/sch:* and not(@scheme='isoschematron')">Rules in the ISO Schematron language must be inside a constraint with a value of 'isoschematron' on the scheme attribute </sch:report> | ||||||||
Ejemplo | This constraint uses Schematron to enforce the presence of the spanTo attribute (which comes from an attribute class) on the addSpan element: <constraintSpec ident="demo-c1" scheme="isoschematron"> <desc>Enforce the presence of the <att>spanTo</att> attribute</desc> <constraint> <sch:assert test="@spanTo">The spanTo= attribute of <sch:name/> is required.</sch:assert> </constraint> </constraintSpec> | ||||||||
Ejemplo | <constraintSpec ident="demo-c2" scheme="isoschematron"> <desc>Implement an accessibility rule which says that pictures should have textual explanations</desc> <constraint> <sch:report test="not(tei:figDesc or tei:head)"> You should provide information in a figure from which we can construct an alt attribute in HTML </sch:report> </constraint> </constraintSpec> | ||||||||
Ejemplo | This constraint uses a language which is not expressed in XML to check whether the title and author are identical: <constraintSpec ident="local" scheme="private"> <constraint> (output = leq(title,author) "title and author cannot be the same") </constraint> </constraintSpec> |