<constraintSpec>

<constraintSpec> (constraint on schema) contains a constraint, expressed in some formal syntax, which cannot be expressed in the structural content model [22.5 Element Specifications]
Moduletagdocs — Documentation Elements
Attributesatt.global (@xml:id, @n, @xml:lang, @xml:base, @xml:space) (att.global.rendition (@rend, @style, @rendition)) (att.global.linking (@corresp, @synch, @sameAs, @copyOf, @next, @prev, @exclude, @select)) (att.global.analytic (@ana)) (att.global.facs (@facs)) (att.global.change (@change)) (att.global.responsibility (@cert, @resp)) (att.global.source (@source)) att.identified (@ident, @predeclare, @module) (att.combinable (@mode) (att.deprecated (@validUntil)) ) att.typed (@type, @subtype)
schemesupplies the name of the language in which the constraints are defined Suggested values include: 1] schematron(ISO Schematron) ; 2] isoschematron(ISO Schematron)
Status Required
Datatype teidata.enumerated
Suggested values include:
schematron
(ISO Schematron)
isoschematron  DeprecatedThis feature will be withdrawn after 2017-12-14
(ISO Schematron)
Note

These Guidelines no longer recommend, and the available TEI stylesheets no longer support, the use of Schematron 1.x within constraintSpec. Thus either the value schematron or the value isoschematron may be used to indicate that ISO Schematron is used within the constraintSpec; the former is preferred, the latter will be removed in a future release.

Member of
Contained by
May contain
Example

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>
Example
<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>
Example

This constraint uses SPITBOL (a language which is not expressed in XML) to check whether the title and author are identical:

<constraintSpec ident="local"
 scheme="SPITBOL">

 <constraint>
   (output = leq(title,author) "title and author cannot be the same")
 </constraint>
</constraintSpec>
SchematronRelationship between scheme attribute and contents: Schematron 1.x

<sch:ns prefix="s"
 uri="http://www.ascc.net/xml/schematron"/>

<sch:report test="tei:constraint/s:* and @scheme = ('isoschematron','schematron')">Rules
in the Schematron 1.* language must be inside a constraintSpec
with a value other than 'schematron' or 'isoschematron' on the
scheme attribute</sch:report>
SchematronRelationship between scheme attribute and contents: ISO Schematron

<sch:ns prefix="sch"
 uri="http://purl.oclc.org/dsdl/schematron"/>

<sch:report test="tei:constraint/sch:* and not( @scheme = ('isoschematron','schematron') )">Rules
in the ISO Schematron language must be inside a constraintSpec
with a value of 'isoschematron' (deprecated) or 'schematron' on the
scheme attribute</sch:report>
Schematron

<sch:ns prefix="sch"
 uri="http://purl.oclc.org/dsdl/schematron"/>

<sch:rule context="tei:macroSpec/tei:constraintSpec[@scheme=('isoschematron','schematron')]/tei:constraint">
<sch:report test="sch:assert|sch:report">An ISO Schematron constraint specification for a macro should not
have an 'assert' or 'report' element without a parent 'rule' element</sch:report>
</sch:rule>
Content model
<content>
 <sequence>
  <alternate minOccurs="0"
   maxOccurs="unbounded">

   <classRef key="model.glossLike"/>
   <classRef key="model.descLike"/>
  </alternate>
  <elementRef key="constraint"
   minOccurs="0"/>

 </sequence>
</content>
Schema Declaration
<rng:element name="constraintSpec">
 <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.typed.attributes"/>
 <rng:attribute name="scheme">
  <rng:choice>
   <rng:value>schematron</rng:value>
   <rng:value>isoschematron</rng:value>
   <rng:ref name="teidata.enumerated"/>
  </rng:choice>
 </rng:attribute>
 <rng:group>
  <rng:zeroOrMore>
   <rng:choice>
    <rng:ref name="model.glossLike"/>
    <rng:ref name="model.descLike"/>
   </rng:choice>
  </rng:zeroOrMore>
  <rng:optional>
   <rng:ref name="constraint"/>
  </rng:optional>
 </rng:group>
</rng:element>
element constraintSpec
{
   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.typed.attributes,
   attribute scheme { "schematron" | "isoschematron" | teidata.enumerated },
   ( ( model.glossLike | model.descLike )*, constraint? )
}