<constraintSpec>
<constraintSpec> (constraint on schema) contains a formal constraint, typically expressed in a rule-based schema language, to which a construct must conform in order to be considered valid [22.5 Element Specifications] | |||||||||||||||||
組件 | tagdocs — Documentation Elements | ||||||||||||||||
屬性 | att.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)
| ||||||||||||||||
俱乐部会员 | |||||||||||||||||
可包含在於 | core: add corr del desc emph head hi item l meeting note orig p q quote ref reg said sic stage title unclear dictionaries: case colloc def dictScrap entryFree etym form gen gram gramGrp hyph iType lang lbl mood number orth per pos pron stress subc syll tns usg xr msdescription: accMat acquisition additions collation condition custEvent decoNote filiation foliation layout musicNotation origin provenance signatures source summary support surrogates typeNote namesdates: occupation tagdocs: attDef classSpec dataSpec elementSpec macroSpec schemaSpec specGrp textstructure: argument body div div1 div2 div3 div4 div5 div6 div7 docEdition epigraph imprimatur postscript salute signed titlePart trailer verse: rhyme | ||||||||||||||||
可包含 | tagdocs: altIdent constraint equiv | ||||||||||||||||
例子 | 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-c2" scheme="schematron"> <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> | ||||||||||||||||
例子 | This constraint uses SPITBOL (a language which is not expressed in XML) to check whether the title and author are identical: | ||||||||||||||||
Schematron | Relationship 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> | ||||||||||||||||
Schematron | Relationship 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 eq 'schematron')">Rules in the ISO Schematron language must be inside a constraintSpec with the value '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 eq '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> | ||||||||||||||||
宣告 | <rng:element name="constraintSpec"> 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.attribute.subtype, attribute type { "deprecationWarning" | teidata.enumerated }?, attribute scheme { "schematron" | teidata.enumerated }, ( ( model.glossLike | model.descLike )*, constraint? ) } |