<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <title>ISO Schematron rules</title>
   <!-- This file generated 2019-07-16T15:14:30Z by 'extract-isosch.xsl'. -->

   <!-- ********************* -->
   <!-- namespaces, declared: -->
   <!-- ********************* -->
   <ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
   <ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
   <ns prefix="rng" uri="http://relaxng.org/ns/structure/1.0"/>
   <ns prefix="s" uri="http://www.ascc.net/xml/schematron"/>
   <ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
   <ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
   <ns prefix="teix" uri="http://www.tei-c.org/ns/Examples"/>

   <!-- ********************* -->
   <!-- namespaces, implicit: -->
   <!-- ********************* -->
   <ns prefix="esp-d2e67101"
       uri="http://www.example.org/cannot/really/use/XInclude"/>
   <ns prefix="esp-d2e67155"
       uri="http://www.example.org/cannot/really/use/XInclude"/>

   <!-- ************ -->
   <!-- constraints: -->
   <!-- ************ -->
   <pattern id="schematron-constraint-tei_customization-att.datable.w3c-att-datable-w3c-when-1">
      <rule context="tei:*[@when]">
        <report test="@notBefore|@notAfter|@from|@to" role="nonfatal">The @when attribute cannot be used with any other att.datable.w3c attributes.</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.datable.w3c-att-datable-w3c-from-2">
      <rule context="tei:*[@from]">
        <report test="@notBefore" role="nonfatal">The @from and @notBefore attributes cannot be used together.</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.datable.w3c-att-datable-w3c-to-3">
      <rule context="tei:*[@to]">
        <report test="@notAfter" role="nonfatal">The @to and @notAfter attributes cannot be used together.</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.datable-calendar-calendar-4">
          <rule context="tei:*[@calendar]">
            <assert test="string-length(.) gt 0"> @calendar indicates the system or calendar to
              which the date represented by the content of this element belongs, but this
              <name/> element has no textual content.</assert>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_customization-att.global-xmlid-unique_xmlIDs-5">
      <rule context="@xml:id">
                              <let name="myID" value="normalize-space(.)"/>
                              <report test="../(ancestor::*|preceding::*)/@xml:id[ normalize-space(.) eq $myID ]">The @xml:id "<value-of select="."/>" on ＜<value-of select="name(..)"/>＞ duplicates an @xml:id found earlier in the document</report>
                           </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-att.measurement-att-measurement-unitRef-6">
      <rule context="tei:*[@unitRef]">
        <report test="@unit" role="info">The @unit attribute may be unnecessary when @unitRef is present.</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.typed-subtypeTyped-7">
      <rule context="tei:*[@subtype]">
        <assert test="@type">The <name/> element should not be categorized in detail with @subtype unless also categorized in general with @type</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.pointing-targetLang-targetLang-8">
          <rule context="tei:*[not(self::tei:schemaSpec)][@targetLang]">
            <assert test="@target">@targetLang should only be used on <name/> if @target is specified.</assert>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_customization-att.styleDef-schemeVersion-schemeVersionRequiresScheme-9">
          <rule context="tei:*[@schemeVersion]">
            <assert test="@scheme and not(@scheme = 'free')">
              @schemeVersion can only be used if @scheme is specified.
            </assert>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_customization-p-abstractModel-structure-p-10">
      <rule context="tei:p">
         <report test="not(ancestor::tei:floatingText) and (ancestor::tei:p or ancestor::tei:ab)          and not(parent::tei:exemplum                |parent::tei:item                |parent::tei:note                |parent::tei:q                |parent::tei:quote                |parent::tei:remarks                |parent::tei:said                |parent::tei:sp                |parent::tei:stage                |parent::tei:cell                |parent::tei:figure                )">
        Abstract model violation: Paragraphs may not occur inside other paragraphs or ab elements.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-p-abstractModel-structure-l-11">
      <rule context="tei:p">
         <report test="ancestor::tei:l[not(.//tei:note//tei:p[. = current()])]">
        Abstract model violation: Lines may not contain higher-level structural elements such as div, p, or ab.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-desc-deprecationInfo-only-in-deprecated-12">
      <rule context="tei:desc[ @type eq 'deprecationInfo']">
	        <assert test="../@validUntil">Information about a
	deprecation should only be present in a specification element
	that is being deprecated: that is, only an element that has a
	@validUntil attribute should have a child &lt;desc
	type="deprecationInfo"&gt;.</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-ptr-ptrAtts-13">
      <rule context="tei:ptr">
         <report test="@target and @cRef">Only one of the
attributes @target and @cRef may be supplied on <name/>.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-ref-refAtts-14">
      <rule context="tei:ref">
         <report test="@target and @cRef">Only one of the
	attributes @target' and @cRef' may be supplied on <name/>
         </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-list-gloss-list-must-have-labels-15">
      <rule context="tei:list[@type='gloss']">
	        <assert test="tei:label">The content of a "gloss" list should include a sequence of one or more pairs of a label element followed by an item element</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-relatedItem-targetorcontent1-16">
      <rule context="tei:relatedItem">
         <report test="@target and count( child::* ) &gt; 0">
If the @target attribute on <name/> is used, the
relatedItem element must be empty</report>
         <assert test="@target or child::*">A relatedItem element should have either a 'target' attribute
        or a child element to indicate the related bibliographic item</assert>
      </rule>
   </pattern>
      
      
    
      
    <pattern id="schematron-constraint-tei_customization-div-abstractModel-structure-l-19">
      <rule context="tei:div">
         <report test="ancestor::tei:l">
        Abstract model violation: Lines may not contain higher-level structural elements such as div.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-div-abstractModel-structure-p-20">
      <rule context="tei:div">
         <report test="ancestor::tei:p or ancestor::tei:ab and not(ancestor::tei:floatingText)">
        Abstract model violation: p and ab may not contain higher-level structural elements such as div.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-att.repeatable-MINandMAXoccurs-21">
      <rule context="*[ @minOccurs  and  @maxOccurs ]">
        <let name="min" value="@minOccurs cast as xs:integer"/>
        <let name="max"
              value="if ( normalize-space( @maxOccurs ) eq 'unbounded')                         then -1                         else @maxOccurs cast as xs:integer"/>
        <assert test="$max eq -1  or  $max ge $min">@maxOccurs should be greater than or equal to @minOccurs</assert>
      </rule>
      <rule context="*[ @minOccurs  and  not( @maxOccurs ) ]">
        <assert test="@minOccurs cast as xs:integer lt 2">When @maxOccurs is not specified, @minOccurs must be 0 or 1</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.identified-spec-in-module-22">
      <rule context="tei:elementSpec[@module]|tei:classSpec[@module]|tei:macroSpec[@module]">
        <assert test="         (not(ancestor::tei:schemaSpec | ancestor::tei:TEI | ancestor::tei:teiCorpus)) or         (not(@module) or          (not(//tei:moduleSpec) and not(//tei:moduleRef))  or         (//tei:moduleSpec[@ident = current()/@module]) or          (//tei:moduleRef[@key = current()/@module]))         ">
        Specification <value-of select="@ident"/>: the value of the module attribute ("<value-of select="@module"/>") 
should correspond to an existing module, via a moduleSpec or
      moduleRef</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-att.deprecated-validUntil-deprecation-two-month-warning-23">
          <rule context="tei:*[@validUntil]">
            <let name="advance_warning_period"
              value="current-date() + xs:dayTimeDuration('P60D')"/>
            <let name="me_phrase"
              value="if (@ident)                                                then concat('The ', @ident )                                                else concat('This ',                                                            local-name(.),                                                            ' of ',                                                            ancestor::tei:*[@ident][1]/@ident )"/>
            <assert test="@validUntil cast as xs:date  ge  current-date()">
              <value-of select="                  concat( $me_phrase,                          'construct is outdated (as of ',                          @validUntil,                          '); ODD processors may ignore it, and its use is no longer supported'                        )"/>
         </assert>
              <assert role="nonfatal"
                 test="@validUntil cast as xs:date  ge  $advance_warning_period">
                <value-of select="concat( $me_phrase, ' construct becomes outdated on ', @validUntil )"/>
              </assert>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_customization-att.deprecated-validUntil-deprecation-should-be-explained-24">
          <rule context="tei:*[@validUntil][ not( self::valDesc | self::valList | self::defaultVal )]">
            <assert test="child::tei:desc[ @type eq 'deprecationInfo']">
              A deprecated construct should include, whenever possible, an explanation, but this <value-of select="name(.)"/> does not have a child &lt;desc type="deprecationInfo"&gt;</assert>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-if-url-then-prefix-25">
                        <rule context="tei:moduleRef[ @url ]">
                           <assert test="@prefix"> a ＜moduleRef＞ that uses the url= attribute should
                        have a prefix= attribute, too </assert>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-no-duplicate-modules-26">
                        <rule context="tei:moduleRef[ @key ]">
                           <let name="mykey" value="@key"/>
                           <report test="preceding-sibling::tei:moduleRef[ @key eq $mykey ]">The
                          '<value-of select="@key"/>' module is included (by reference) more
                        than once</report>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-element-is-in-module-27">
                        <rule context="tei:moduleRef[@key eq 'header']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'teiHeader', 'fileDesc', 'titleStmt', 'sponsor', 'funder', 'principal', 'editionStmt', 'edition', 'extent', 'publicationStmt', 'distributor', 'authority', 'idno', 'availability', 'licence', 'seriesStmt', 'notesStmt', 'sourceDesc', 'biblFull', 'encodingDesc', 'schemaRef', 'projectDesc', 'samplingDecl', 'editorialDecl', 'correction', 'normalization', 'quotation', 'hyphenation', 'segmentation', 'stdVals', 'interpretation', 'punctuation', 'tagsDecl', 'tagUsage', 'namespace', 'rendition', 'styleDefDecl', 'refsDecl', 'cRefPattern', 'prefixDef', 'listPrefixDef', 'refState', 'classDecl', 'taxonomy', 'category', 'catDesc', 'geoDecl', 'unitDecl', 'unitDef', 'conversion', 'appInfo', 'application', 'profileDesc', 'handNote', 'abstract', 'creation', 'langUsage', 'language', 'textClass', 'keywords', 'classCode', 'catRef', 'calendarDesc', 'calendar', 'correspDesc', 'correspAction', 'correspContext', 'xenoData', 'revisionDesc', 'change', 'scriptNote', 'listChange' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'teiHeader', 'fileDesc', 'titleStmt', 'sponsor', 'funder', 'principal', 'editionStmt', 'edition', 'extent', 'publicationStmt', 'distributor', 'authority', 'idno', 'availability', 'licence', 'seriesStmt', 'notesStmt', 'sourceDesc', 'biblFull', 'encodingDesc', 'schemaRef', 'projectDesc', 'samplingDecl', 'editorialDecl', 'correction', 'normalization', 'quotation', 'hyphenation', 'segmentation', 'stdVals', 'interpretation', 'punctuation', 'tagsDecl', 'tagUsage', 'namespace', 'rendition', 'styleDefDecl', 'refsDecl', 'cRefPattern', 'prefixDef', 'listPrefixDef', 'refState', 'classDecl', 'taxonomy', 'category', 'catDesc', 'geoDecl', 'unitDecl', 'unitDef', 'conversion', 'appInfo', 'application', 'profileDesc', 'handNote', 'abstract', 'creation', 'langUsage', 'language', 'textClass', 'keywords', 'classCode', 'catRef', 'calendarDesc', 'calendar', 'correspDesc', 'correspAction', 'correspContext', 'xenoData', 'revisionDesc', 'change', 'scriptNote', 'listChange' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'core']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'p', 'foreign', 'emph', 'hi', 'distinct', 'said', 'quote', 'q', 'cit', 'mentioned', 'soCalled', 'desc', 'gloss', 'term', 'sic', 'corr', 'choice', 'reg', 'orig', 'gap', 'add', 'del', 'unclear', 'name', 'rs', 'email', 'address', 'addrLine', 'street', 'postCode', 'postBox', 'num', 'measure', 'measureGrp', 'unit', 'date', 'time', 'abbr', 'expan', 'ptr', 'ref', 'list', 'item', 'label', 'head', 'headLabel', 'headItem', 'note', 'index', 'media', 'graphic', 'binaryObject', 'milestone', 'gb', 'pb', 'lb', 'cb', 'analytic', 'monogr', 'series', 'author', 'editor', 'respStmt', 'resp', 'title', 'meeting', 'imprint', 'publisher', 'biblScope', 'citedRange', 'pubPlace', 'bibl', 'biblStruct', 'listBibl', 'relatedItem', 'l', 'lg', 'sp', 'speaker', 'stage', 'teiCorpus', 'divGen', 'textLang' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'p', 'foreign', 'emph', 'hi', 'distinct', 'said', 'quote', 'q', 'cit', 'mentioned', 'soCalled', 'desc', 'gloss', 'term', 'sic', 'corr', 'choice', 'reg', 'orig', 'gap', 'add', 'del', 'unclear', 'name', 'rs', 'email', 'address', 'addrLine', 'street', 'postCode', 'postBox', 'num', 'measure', 'measureGrp', 'unit', 'date', 'time', 'abbr', 'expan', 'ptr', 'ref', 'list', 'item', 'label', 'head', 'headLabel', 'headItem', 'note', 'index', 'media', 'graphic', 'binaryObject', 'milestone', 'gb', 'pb', 'lb', 'cb', 'analytic', 'monogr', 'series', 'author', 'editor', 'respStmt', 'resp', 'title', 'meeting', 'imprint', 'publisher', 'biblScope', 'citedRange', 'pubPlace', 'bibl', 'biblStruct', 'listBibl', 'relatedItem', 'l', 'lg', 'sp', 'speaker', 'stage', 'teiCorpus', 'divGen', 'textLang' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'textstructure']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'TEI', 'text', 'body', 'group', 'floatingText', 'div', 'div1', 'div2', 'div3', 'div4', 'div5', 'div6', 'div7', 'trailer', 'byline', 'dateline', 'argument', 'epigraph', 'opener', 'closer', 'salute', 'signed', 'postscript', 'titlePage', 'docTitle', 'titlePart', 'docAuthor', 'imprimatur', 'docEdition', 'docImprint', 'docDate', 'front', 'back' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'TEI', 'text', 'body', 'group', 'floatingText', 'div', 'div1', 'div2', 'div3', 'div4', 'div5', 'div6', 'div7', 'trailer', 'byline', 'dateline', 'argument', 'epigraph', 'opener', 'closer', 'salute', 'signed', 'postscript', 'titlePage', 'docTitle', 'titlePart', 'docAuthor', 'imprimatur', 'docEdition', 'docImprint', 'docDate', 'front', 'back' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'gaiji']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'g', 'char', 'charName', 'charProp', 'charDecl', 'glyph', 'glyphName', 'localName', 'mapping', 'unicodeName', 'value' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'g', 'char', 'charName', 'charProp', 'charDecl', 'glyph', 'glyphName', 'localName', 'mapping', 'unicodeName', 'value' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'verse']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'metDecl', 'metSym', 'caesura', 'rhyme' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'metDecl', 'metSym', 'caesura', 'rhyme' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'drama']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'set', 'prologue', 'epilogue', 'performance', 'castList', 'castGroup', 'castItem', 'role', 'roleDesc', 'actor', 'spGrp', 'move', 'view', 'camera', 'sound', 'caption', 'tech' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'set', 'prologue', 'epilogue', 'performance', 'castList', 'castGroup', 'castItem', 'role', 'roleDesc', 'actor', 'spGrp', 'move', 'view', 'camera', 'sound', 'caption', 'tech' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'spoken']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'scriptStmt', 'recordingStmt', 'recording', 'equipment', 'broadcast', 'transcriptionDesc', 'u', 'pause', 'vocal', 'kinesic', 'incident', 'writing', 'shift', 'annotationBlock' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'scriptStmt', 'recordingStmt', 'recording', 'equipment', 'broadcast', 'transcriptionDesc', 'u', 'pause', 'vocal', 'kinesic', 'incident', 'writing', 'shift', 'annotationBlock' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'dictionaries']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'superEntry', 'entry', 'entryFree', 'hom', 'sense', 'dictScrap', 'form', 'orth', 'pron', 'hyph', 'syll', 'stress', 'gram', 'gen', 'number', 'case', 'per', 'tns', 'mood', 'iType', 'gramGrp', 'pos', 'subc', 'colloc', 'def', 'etym', 'lang', 'usg', 'lbl', 'xr', 're', 'oRef', 'pRef' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'superEntry', 'entry', 'entryFree', 'hom', 'sense', 'dictScrap', 'form', 'orth', 'pron', 'hyph', 'syll', 'stress', 'gram', 'gen', 'number', 'case', 'per', 'tns', 'mood', 'iType', 'gramGrp', 'pos', 'subc', 'colloc', 'def', 'etym', 'lang', 'usg', 'lbl', 'xr', 're', 'oRef', 'pRef' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'msdescription']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'msDesc', 'catchwords', 'dimensions', 'dim', 'height', 'depth', 'width', 'heraldry', 'locus', 'locusGrp', 'material', 'objectType', 'origDate', 'origPlace', 'secFol', 'signatures', 'stamp', 'watermark', 'msIdentifier', 'institution', 'repository', 'collection', 'altIdentifier', 'msName', 'colophon', 'explicit', 'filiation', 'finalRubric', 'incipit', 'msContents', 'msItem', 'msItemStruct', 'rubric', 'summary', 'physDesc', 'objectDesc', 'supportDesc', 'support', 'collation', 'foliation', 'condition', 'layoutDesc', 'layout', 'handDesc', 'typeDesc', 'typeNote', 'scriptDesc', 'musicNotation', 'decoDesc', 'decoNote', 'additions', 'bindingDesc', 'binding', 'sealDesc', 'seal', 'accMat', 'history', 'origin', 'provenance', 'acquisition', 'additional', 'adminInfo', 'recordHist', 'source', 'custodialHist', 'custEvent', 'surrogates', 'msPart', 'msFrag' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'msDesc', 'catchwords', 'dimensions', 'dim', 'height', 'depth', 'width', 'heraldry', 'locus', 'locusGrp', 'material', 'objectType', 'origDate', 'origPlace', 'secFol', 'signatures', 'stamp', 'watermark', 'msIdentifier', 'institution', 'repository', 'collection', 'altIdentifier', 'msName', 'colophon', 'explicit', 'filiation', 'finalRubric', 'incipit', 'msContents', 'msItem', 'msItemStruct', 'rubric', 'summary', 'physDesc', 'objectDesc', 'supportDesc', 'support', 'collation', 'foliation', 'condition', 'layoutDesc', 'layout', 'handDesc', 'typeDesc', 'typeNote', 'scriptDesc', 'musicNotation', 'decoDesc', 'decoNote', 'additions', 'bindingDesc', 'binding', 'sealDesc', 'seal', 'accMat', 'history', 'origin', 'provenance', 'acquisition', 'additional', 'adminInfo', 'recordHist', 'source', 'custodialHist', 'custEvent', 'surrogates', 'msPart', 'msFrag' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'transcr']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'facsimile', 'sourceDoc', 'surface', 'surfaceGrp', 'zone', 'path', 'addSpan', 'damage', 'damageSpan', 'delSpan', 'ex', 'fw', 'handNotes', 'handShift', 'am', 'restore', 'space', 'subst', 'substJoin', 'supplied', 'surplus', 'secl', 'line', 'listTranspose', 'metamark', 'mod', 'redo', 'retrace', 'transpose', 'undo' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'facsimile', 'sourceDoc', 'surface', 'surfaceGrp', 'zone', 'path', 'addSpan', 'damage', 'damageSpan', 'delSpan', 'ex', 'fw', 'handNotes', 'handShift', 'am', 'restore', 'space', 'subst', 'substJoin', 'supplied', 'surplus', 'secl', 'line', 'listTranspose', 'metamark', 'mod', 'redo', 'retrace', 'transpose', 'undo' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'textcrit']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'app', 'listApp', 'lem', 'rdg', 'rdgGrp', 'witDetail', 'wit', 'listWit', 'witness', 'witStart', 'witEnd', 'lacunaStart', 'lacunaEnd', 'variantEncoding' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'app', 'listApp', 'lem', 'rdg', 'rdgGrp', 'witDetail', 'wit', 'listWit', 'witness', 'witStart', 'witEnd', 'lacunaStart', 'lacunaEnd', 'variantEncoding' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'namesdates']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'orgName', 'persName', 'surname', 'forename', 'genName', 'nameLink', 'addName', 'roleName', 'placeName', 'bloc', 'country', 'region', 'settlement', 'district', 'offset', 'geogName', 'geogFeat', 'affiliation', 'age', 'birth', 'climate', 'death', 'education', 'event', 'faith', 'floruit', 'geo', 'langKnowledge', 'langKnown', 'listOrg', 'listEvent', 'listPerson', 'listPlace', 'location', 'nationality', 'occupation', 'org', 'listRelation', 'person', 'persona', 'personGrp', 'place', 'population', 'relation', 'residence', 'sex', 'socecStatus', 'state', 'terrain', 'trait', 'objectName', 'object', 'listObject', 'objectIdentifier', 'nym', 'listNym' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'orgName', 'persName', 'surname', 'forename', 'genName', 'nameLink', 'addName', 'roleName', 'placeName', 'bloc', 'country', 'region', 'settlement', 'district', 'offset', 'geogName', 'geogFeat', 'affiliation', 'age', 'birth', 'climate', 'death', 'education', 'event', 'faith', 'floruit', 'geo', 'langKnowledge', 'langKnown', 'listOrg', 'listEvent', 'listPerson', 'listPlace', 'location', 'nationality', 'occupation', 'org', 'listRelation', 'person', 'persona', 'personGrp', 'place', 'population', 'relation', 'residence', 'sex', 'socecStatus', 'state', 'terrain', 'trait', 'objectName', 'object', 'listObject', 'objectIdentifier', 'nym', 'listNym' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'figures']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'table', 'row', 'cell', 'formula', 'notatedMusic', 'figure', 'figDesc' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'table', 'row', 'cell', 'formula', 'notatedMusic', 'figure', 'figDesc' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'corpus']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'textDesc', 'particDesc', 'settingDesc', 'channel', 'constitution', 'derivation', 'domain', 'factuality', 'interaction', 'preparedness', 'purpose', 'setting', 'locale', 'activity' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'textDesc', 'particDesc', 'settingDesc', 'channel', 'constitution', 'derivation', 'domain', 'factuality', 'interaction', 'preparedness', 'purpose', 'setting', 'locale', 'activity' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'linking']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'link', 'linkGrp', 'ab', 'anchor', 'seg', 'when', 'timeline', 'join', 'joinGrp', 'alt', 'altGrp' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'link', 'linkGrp', 'ab', 'anchor', 'seg', 'when', 'timeline', 'join', 'joinGrp', 'alt', 'altGrp' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'analysis']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 's', 'cl', 'phr', 'w', 'm', 'c', 'pc', 'span', 'spanGrp', 'interp', 'interpGrp' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 's', 'cl', 'phr', 'w', 'm', 'c', 'pc', 'span', 'spanGrp', 'interp', 'interpGrp' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'iso-fs']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'fsdDecl', 'fsDecl', 'fsDescr', 'fsdLink', 'fDecl', 'fDescr', 'vRange', 'vDefault', 'if', 'then', 'fsConstraints', 'cond', 'bicond', 'iff', 'fs', 'f', 'binary', 'symbol', 'numeric', 'string', 'vLabel', 'vColl', 'default', 'vAlt', 'vNot', 'vMerge', 'fLib', 'fvLib' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'fsdDecl', 'fsDecl', 'fsDescr', 'fsdLink', 'fDecl', 'fDescr', 'vRange', 'vDefault', 'if', 'then', 'fsConstraints', 'cond', 'bicond', 'iff', 'fs', 'f', 'binary', 'symbol', 'numeric', 'string', 'vLabel', 'vColl', 'default', 'vAlt', 'vNot', 'vMerge', 'fLib', 'fvLib' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'nets']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'graph', 'node', 'arc', 'tree', 'root', 'iNode', 'leaf', 'eTree', 'triangle', 'eLeaf', 'forest', 'listForest' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'graph', 'node', 'arc', 'tree', 'root', 'iNode', 'leaf', 'eTree', 'triangle', 'eLeaf', 'forest', 'listForest' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'certainty']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'precision', 'certainty', 'respons' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'precision', 'certainty', 'respons' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                        <rule context="tei:moduleRef[@key eq 'tagdocs']">
                           <let name="include" value="tokenize( normalize-space(@include),' ')"/>
                           <let name="except" value="tokenize( normalize-space(@except), ' ')"/>
                           <assert test="every $gi in $include satisfies $gi = ( 'att', 'code', 'eg', 'egXML', 'gi', 'ident', 'tag', 'val', 'specList', 'specDesc', 'classRef', 'elementRef', 'macroRef', 'moduleRef', 'moduleSpec', 'schemaSpec', 'specGrp', 'specGrpRef', 'elementSpec', 'classSpec', 'dataSpec', 'macroSpec', 'remarks', 'listRef', 'exemplum', 'classes', 'memberOf', 'equiv', 'altIdent', 'model', 'modelSequence', 'modelGrp', 'outputRendition', 'paramList', 'paramSpec', 'param', 'content', 'sequence', 'alternate', 'constraint', 'constraintSpec', 'attList', 'attDef', 'attRef', 'datatype', 'dataRef', 'dataFacet', 'defaultVal', 'valDesc', 'valItem', 'valList', 'textNode', 'anyElement', 'empty' )">One or more of the elements included on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                           <assert test="every $gi in $except  satisfies $gi = ( 'att', 'code', 'eg', 'egXML', 'gi', 'ident', 'tag', 'val', 'specList', 'specDesc', 'classRef', 'elementRef', 'macroRef', 'moduleRef', 'moduleSpec', 'schemaSpec', 'specGrp', 'specGrpRef', 'elementSpec', 'classSpec', 'dataSpec', 'macroSpec', 'remarks', 'listRef', 'exemplum', 'classes', 'memberOf', 'equiv', 'altIdent', 'model', 'modelSequence', 'modelGrp', 'outputRendition', 'paramList', 'paramSpec', 'param', 'content', 'sequence', 'alternate', 'constraint', 'constraintSpec', 'attList', 'attDef', 'attRef', 'datatype', 'dataRef', 'dataFacet', 'defaultVal', 'valDesc', 'valItem', 'valList', 'textNode', 'anyElement', 'empty' )">One or more of the elements excepted on the '<value-of select="@key"/>' ＜moduleRef＞ are not actually available in that module</assert>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-modref-28">
      <rule context="tei:moduleRef">
        <report test="* and @key">
Child elements of <name/> are only allowed when an external module is being loaded
        </report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-include-include-required-29">
                              <rule context="tei:moduleRef[ @key eq 'textstructure' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('TEI'=$inclusions)">Not including ＜TEI＞ in your
                            schema guarantees it is not TEI conformant, and will likely be outright
                            invalid</report>
                              </rule>
                              <rule context="tei:moduleRef[ @key eq 'header' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('teiHeader'=$inclusions)">Not including ＜teiHeader＞
                            in your schema guarantees it is not TEI conformant</report>
                              </rule>
                              <rule context="tei:moduleRef[ @key eq 'header' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('fileDesc'=$inclusions)">Not including ＜fileDesc＞ in
                            your schema guarantees it is not TEI conformant</report>
                              </rule>
                              <rule context="tei:moduleRef[ @key eq 'header' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('titleStmt'=$inclusions)">Not including ＜titleStmt＞
                            in your schema guarantees it is not TEI conformant</report>
                              </rule>
                              <rule context="tei:moduleRef[ @key eq 'header' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('publicationStmt'=$inclusions)">Not including
                            ＜publicationStmt＞ in your schema guarantees it is not TEI
                            conformant</report>
                              </rule>
                              <rule context="tei:moduleRef[ @key eq 'header' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('sourceDesc'=$inclusions)">Not including
                            ＜sourceDesc＞ in your schema guarantees it is not TEI
                            conformant</report>
                              </rule>
                              <rule context="tei:moduleRef[ @key eq 'core' and @include ]">
                                 <let name="inclusions" value="tokenize( @include, '\s+' )"/>
                                 <report test="not('title'=$inclusions)">Not including ＜title＞ in your
                            schema guarantees it is not TEI conformant</report>
                              </rule>
                           </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-except-need-required-30">
      <rule context="tei:moduleRef/@except">
                              <let name="exceptions" value="tokenize( ., '\s+' )"/>
                              
                              
                              
                              
                              
                              
                              <report test="'TEI'=$exceptions">Removing ＜TEI＞ from your schema
                          guarantees it is not TEI conformant, and will will likely be outright
                          invalid</report>
                              <report test="'teiHeader'=$exceptions">Removing ＜teiHeader＞ from your
                          schema guarantees it is not TEI conformant</report>
                              <report test="'fileDesc'=$exceptions">Removing ＜fileDesc＞ from your
                          schema guarantees it is not TEI conformant</report>
                              <report test="'titleStmt'=$exceptions">Removing ＜titleStmt＞ from your
                          schema guarantees it is not TEI conformant</report>
                              <report test="'title'=$exceptions">Removing ＜title＞ from your schema
                          guarantees it is not TEI conformant</report>
                              <report test="'publicationStmt'=$exceptions">Removing
                          ＜publicationStmt＞ from your schema guarantees it is not TEI
                          conformant</report>
                              <report test="'sourceDesc'=$exceptions">Removing ＜sourceDesc＞ from
                          your schema guarantees it is not TEI conformant</report>
                           </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-moduleRef-prefix-not-same-prefix-31">
          <rule context="tei:moduleRef">
            <report test="//*[ not( generate-id(.) eq generate-id(      current() ) ) ]/@prefix = @prefix">The prefix attribute
	    of <name/> should not match that of any other
	    element (it would defeat the purpose)</report>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_customization-schemaSpec-required-modules-32">
      <rule context="tei:schemaSpec">
                        <assert test="                       ( tei:moduleRef[ @key eq 'tei'] or tei:specGrpRef[ id( substring-after( normalize-space( @target ), '#') )/tei:moduleRef[ @key eq 'tei'] ] )                                             and                       ( tei:moduleRef[ @key eq 'core'] or tei:specGrpRef[ id( substring-after( normalize-space( @target ), '#') )/tei:moduleRef[ @key eq 'core'] ] )                                             and                       ( tei:moduleRef[ @key eq 'header'] or tei:specGrpRef[ id( substring-after( normalize-space( @target ), '#') )/tei:moduleRef[ @key eq 'header'] ] )                                             and                       ( tei:moduleRef[ @key eq 'textstructure'] or tei:specGrpRef[ id( substring-after( normalize-space( @target ), '#') )/tei:moduleRef[ @key eq 'textstructure'] ] )                                             "> missing one or more of the required modules (tei, core, header,
                      textstructure). </assert>
                     </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-schemaSpec-no-outside-specs-33">
                        <rule context="tei:classSpec[ not( ancestor::tei:schemaSpec ) ]                                      | tei:elementSpec[ not( ancestor::tei:schemaSpec ) ]                                      | tei:macroSpec[ not( ancestor::tei:schemaSpec ) ]">
                           <assert test="//tei:schemaSpec//tei:specGrpRef                                         [ substring-after( normalize-space( @target ), '#')                                            eq                                           current()/ancestor::tei:specGrp/@xml:id ]">＜<name/>＞ should be in ＜schemaSpec＞ or referred to from within
                        ＜schemaSpec＞</assert>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-schemaSpec-only-one-schemaSpec-34">
                        <rule context="/">
                           <report test="count( //tei:schemaSpec ) eq 0">There's no ＜schemaSpec＞, so
                        this isn't much of a TEI customization</report>
                           <report test="count( //tei:schemaSpec ) gt 1">You have more than one
                        ＜schemaSpec＞; current ODD processors will only look at the first
                        one</report>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-elementSpec-module-except-when-add-35">
      <rule context="tei:elementSpec">
                        <assert test="@mode">in a customization ODD, the mode= attribute of
                      ＜elementSpec＞ should be specified</assert>
                        <report test="not( @module )  and  not( @mode='add')">the module= attribute of ＜elementSpec＞ must be specified anytime the mode= is
                      not 'add'</report>
                     </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-elementSpec-only-1-per-36">
      <rule context="tei:elementSpec">
                        <report test="//tei:elementSpec[ @ident eq current()/@ident  and  not( . is current() ) ]">Current ODD processors will not correctly handle more than one ＜elementSpec＞ with the same @ident</report>
                     </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-elementSpec-dont-delete-required-37">
      <rule context="tei:elementSpec">
                        <report test="@mode='delete' and @ident='TEI'">Removing ＜TEI＞ from your
                      schema guarantees it is not TEI conformant</report>
                        <report test="@mode='delete' and @ident='teiHeader'">Removing ＜teiHeader＞
                      from your schema guarantees it is not TEI conformant</report>
                        <report test="@mode='delete' and @ident='fileDesc'">Removing ＜fileDesc＞ from
                      your schema guarantees it is not TEI conformant</report>
                        <report test="@mode='delete' and @ident='titleStmt'">Removing ＜titleStmt＞
                      from your schema guarantees it is not TEI conformant</report>
                        <report test="@mode='delete' and @ident='title'">Removing ＜title＞ from your
                      schema guarantees it is not TEI conformant</report>
                        <report test="@mode='delete' and @ident='publicationStmt'">Removing
                      ＜publicationStmt＞ from your schema guarantees it is not TEI
                      conformant</report>
                        <report test="@mode='delete' and @ident='sourceDesc'">Removing ＜sourceDesc＞
                      from your schema guarantees it is not TEI conformant</report>
                     </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-elementSpec-content_when_adding-38">
                        <rule context="tei:elementSpec[@mode = ('add','replace')]">
                           <assert test="tei:content">When adding a new element (whether replacing an old one or not), a content model must be specified; but this ＜elementSpec＞ does not have a ＜content＞ child.</assert>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-elementSpec-empty_when_deleting-39">
                        <rule context="tei:elementSpec[ @mode eq 'delete']">
                           <report test="*">When used to delete an element from your schema, the ＜elementSpec＞ should be empty</report>
                        </rule>
                     </pattern>
   <pattern id="schematron-constraint-tei_customization-altIdent-altIdent-only-NCName-40">
      <rule context="tei:altIdent">
                        <report test="if ( parent::taxonomy | parent::valItem )                                       then false()                                       else contains( .,':')"> The content of ＜altIdent＞ should be an XML Name (w/o a namespace prefix),
                      unless a child of ＜valItem＞ (and even then, it's not a bad idea :-)</report>
                     </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-model-no_dup_default_models-41">
      <rule context="tei:model[ not( parent::tei:modelSequence ) ][ not( @predicate ) ]">
        <let name="output" value="normalize-space( @output )"/>
        <report test="following-sibling::tei:model                             [ not( @predicate )]                             [ normalize-space( @output ) eq $output ]">
          There are 2 (or more) 'model' elements in this '<value-of select="local-name(..)"/>'
          that have no predicate, but are targeted to the same output
          ("<value-of select="( $output, parent::modelGrp/@output, 'all')[1]"/>")</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-model-no_dup_models-42">
      <rule context="tei:model[ not( parent::tei:modelSequence ) ][ @predicate ]">
        <let name="predicate" value="normalize-space( @predicate )"/>
        <let name="output" value="normalize-space( @output )"/>
        <report test="following-sibling::tei:model                             [ normalize-space( @predicate ) eq $predicate ]                             [ normalize-space( @output ) eq $output ]">
          There are 2 (or more) 'model' elements in this
          '<value-of select="local-name(..)"/>' that have
          the same predicate, and are targeted to the same output
          ("<value-of select="( $output, parent::modelGrp/@output, 'all')[1]"/>")</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-modelSequence-no_outputs_nor_predicates_4_my_kids-43">
      <rule context="tei:modelSequence">
         <report test="tei:model[@output]" role="warning">The 'model' children
      of a 'modelSequence' element inherit the @output attribute of the
      parent 'modelSequence', and thus should not have their own</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-content-empty-content-deprecated-44">
      <rule context="tei:content">
         <assert test="*">The use of the &lt;content&gt; element
      without any child elements is deprecated, and will be considered
      invalid after 2019-08-25. Use a child &lt;empty&gt; element to
      indicate that the element being specified is not allowed to have
      content.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-sequence-sequencechilden-45">
      <rule context="tei:sequence">
         <assert test="count(*)&gt;1">The sequence element must have at least two child elements</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-alternate-alternatechilden-46">
      <rule context="tei:alternate">
         <assert test="count(*)&gt;1">The alternate element must have at least two child elements</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-constraintSpec-sch_no_more-47">
      <rule context="tei:constraintSpec">
      
         <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</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-constraintSpec-isosch-48">
      <rule context="tei:constraintSpec">
      
         <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</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-constraintSpec-needrules-49">
      
      <rule context="tei:macroSpec/tei:constraintSpec[@scheme eq 'schematron']/tei:constraint">
        <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</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-attDef-attDefContents-50">
      <rule context="tei:attDef">
      
         <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 @<value-of select="@ident"/> attribute in the <value-of select="ancestor::*[@ident][1]/@ident"/>
            <value-of select="' '"/>
            <value-of select="local-name(ancestor::*[@ident][1])"/> should have a closed valList or a datatype</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_customization-attDef-noDefault4Required-51">
      <rule context="tei:attDef[@usage eq 'req']">
        <report test="tei:defaultVal">It does not make sense to make "<value-of select="normalize-space(tei:defaultVal)"/>" the default value of @<value-of select="@ident"/>, because that attribute is required.</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-attDef-defaultIsInClosedList-twoOrMore-52">
      <rule context="tei:attDef[   tei:defaultVal   and   tei:valList[@type eq 'closed']   and   tei:datatype[    @maxOccurs &gt; 1    or    @minOccurs &gt; 1    or    @maxOccurs = 'unbounded'    ]   ]">
        <assert test="     tokenize(normalize-space(tei:defaultVal),' ')     =     tei:valList/tei:valItem/@ident">In the <value-of select="local-name(ancestor::*[@ident][1])"/> defining
        <value-of select="ancestor::*[@ident][1]/@ident"/> the default value of the
        @<value-of select="@ident"/> attribute is not among the closed list of possible
        values</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-attDef-defaultIsInClosedList-one-53">
      <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()    )]   ]">
        <assert test="string(tei:defaultVal)      =      tei:valList/tei:valItem/@ident">In the <value-of select="local-name(ancestor::*[@ident][1])"/> defining
        <value-of select="ancestor::*[@ident][1]/@ident"/> the default value of the
        @<value-of select="@ident"/> attribute is not among the closed list of possible
        values</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-dataRef-restrictDataFacet-54">
      <rule context="tei:dataRef[tei:dataFacet]">
        <assert test="@name" role="nonfatal">Data facets can only be specified for references to datatypes specified by
          XML Schemas: Part 2: Datatypes</assert>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-dataRef-restrictAttRestriction-55">
      <rule context="tei:dataRef[tei:dataFacet]">
        <report test="@restriction" role="nonfatal">The attribute restriction cannot be used when dataFacet elements are present.</report>
      </rule>
    </pattern>
   <pattern id="schematron-constraint-tei_customization-mode-child-sanity-56">
                     <rule context="*[ @mode eq 'delete' ]">
                        <report test="child::*">The specification element ＜<name/>＞ has both a
                      mode= of "delete" and child elements, which is incongruous</report>
                     </rule>
                     <rule context="                       tei:valList[ @mode = ('add','change','replace') ]                     | tei:moduleSpec[ @mode = ('add','change','replace') ]                     | tei:schemaSpec[ @mode = ('add','change','replace') ]                     | tei:elementSpec[ @mode = ('add','change','replace') ]                     | tei:classSpec[ @mode = ('add','change','replace') ]                     | tei:macroSpec[ @mode = ('add','change','replace') ]                     | tei:constraintSpec[ @mode = ('add','change','replace') ]                     | tei:attDef[ @mode = ('add','change','replace') ]                     | tei:classes[ @mode = ('add','change','replace') ]">
                        <assert test="child::* | (@* except (@mode, @ident))">The specification
                      element ＜<name/>＞ has a mode= of "<value-of select="@mode"/>", but
                      does not have any child elements or schema-changing attributes, which is
                      incongruous</assert>
                     </rule>
                  </pattern>
   <pattern id="schematron-constraint-tei_customization-tei-source-57">
                     <rule context=" tei:classRef[@source]                                      |tei:dataRef[@source]                                      |tei:elementRef[@source]                                      |tei:macroRef[@source]                                      |tei:moduleRef[@source]                                      |tei:schemaSpec[@source]">
                        <assert test="matches(normalize-space(@source), '^tei:([0-9]+\.[0-9]+\.[0-9]+|current)$')"
                 role="nonfatal">The @source attribute of ＜<name/>＞ is not in the
                      recommended format</assert>
                     </rule>
                  </pattern>

   <!-- *********** -->
   <!-- deprecated: -->
   <!-- *********** -->


   <!-- **************** -->
   <!-- parameter lists: -->
   <!-- **************** -->
   <pattern id="teipm-model-paramList-1">
      <rule context="tei:param[parent::tei:model/@behaviour='alternate']">
         <assert role="error" test="@name='default'   or  @name='alternate'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: default, alternate</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-2">
      <rule context="tei:param[parent::tei:model/@behaviour='anchor']">
         <assert role="error" test="@name='id'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: id</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-3">
      <rule context="tei:param[parent::tei:model/@behaviour='block']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-4">
      <rule context="tei:param[parent::tei:model/@behaviour='body']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-5">
      <rule context="tei:param[parent::tei:model/@behaviour='break']">
         <assert role="error" test="@name='type'   or  @name='label'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: type, label</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-6">
      <rule context="tei:param[parent::tei:model/@behaviour='cell']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-7">
      <rule context="tei:param[parent::tei:model/@behaviour='cit']">
         <assert role="error" test="@name='content'   or  @name='source'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content, source</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-8">
      <rule context="tei:param[parent::tei:model/@behaviour='document']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-9">
      <rule context="tei:param[parent::tei:model/@behaviour='figure']">
         <assert role="error" test="@name='title'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: title</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-10">
      <rule context="tei:param[parent::tei:model/@behaviour='glyph']">
         <assert role="error" test="@name='uri'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: uri</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-11">
      <rule context="tei:param[parent::tei:model/@behaviour='graphic']">
         <assert role="error"
                 test="@name='url'   or  @name='width'   or  @name='height'   or  @name='scale'   or  @name='title'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: url, width, height, scale, title</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-12">
      <rule context="tei:param[parent::tei:model/@behaviour='heading']">
         <assert role="error" test="@name='content'   or  @name='level'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content, level</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-13">
      <rule context="tei:param[parent::tei:model/@behaviour='index']">
         <assert role="error" test="@name='type'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: type</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-14">
      <rule context="tei:param[parent::tei:model/@behaviour='inline']">
         <assert role="error" test="@name='content'   or  @name='label'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content, label</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-15">
      <rule context="tei:param[parent::tei:model/@behaviour='link']">
         <assert role="error" test="@name='content'   or  @name='uri'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content, uri</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-16">
      <rule context="tei:param[parent::tei:model/@behaviour='list']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-17">
      <rule context="tei:param[parent::tei:model/@behaviour='listItem']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-18">
      <rule context="tei:param[parent::tei:model/@behaviour='metadata']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-19">
      <rule context="tei:param[parent::tei:model/@behaviour='note']">
         <assert role="error"
                 test="@name='content'   or  @name='place'   or  @name='label'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content, place, label</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-20">
      <rule context="tei:param[parent::tei:model/@behaviour='paragraph']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-21">
      <rule context="tei:param[parent::tei:model/@behaviour='row']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-22">
      <rule context="tei:param[parent::tei:model/@behaviour='section']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-23">
      <rule context="tei:param[parent::tei:model/@behaviour='table']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-24">
      <rule context="tei:param[parent::tei:model/@behaviour='text']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
   <pattern id="teipm-model-paramList-25">
      <rule context="tei:param[parent::tei:model/@behaviour='title']">
         <assert role="error" test="@name='content'">
          Parameter name '<value-of select="@name"/>'  (on <value-of select="ancestor::tei:elementSpec/@ident"/>) not allowed.
          Must  be  drawn from the list: content</assert>
      </rule>
   </pattern>
</schema>
