<?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:13:21Z 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"/>

   <!-- ********************* -->
   <!-- namespaces, implicit: -->
   <!-- ********************* -->


   <!-- ************ -->
   <!-- constraints: -->
   <!-- ************ -->
   <pattern id="schematron-constraint-tei_simplePrint-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_simplePrint-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_simplePrint-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_simplePrint-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_simplePrint-att.global.rendition-renditionpointer-5">
                  <rule context="tei:*[@rendition]">
                    <let name="results"
              value="for $val in tokenize(normalize-space(@rendition),'\s+') return starts-with($val,'simple:')        or        (starts-with($val,'#')        and        //tei:rendition[@xml:id=substring($val,2)])"/>
                    <assert test="every $x in $results satisfies $x"> Error: Each of the rendition
                      values in "<value-of select="@rendition"/>" must point to a local ID or to a
                      token in the Simple scheme (<value-of select="$results"/>)</assert>
                  </rule>
                </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-att.global.rendition-corresppointer-6">
                  <rule context="tei:*[@corresp]">
                    <let name="results"
              value="for $t in tokenize(normalize-space(@corresp),'\s+') return starts-with($t,'#') and not(id(substring($t,2)))"/>
                    <report test="some $x in $results  satisfies $x"> Error: Every local pointer in
                        "<value-of select="@corresp"/>" must point to an ID in this document
                        (<value-of select="$results"/>)</report>
                  </rule>
                </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-att.measurement-att-measurement-unitRef-7">
      <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_simplePrint-att.typed-subtypeTyped-8">
      <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_simplePrint-att.pointing-targetLang-targetLang-9">
          <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_simplePrint-att.pointing-target-validtarget-10">
                      <rule context="tei:*[@target]">
                        <let name="results"
              value="for $t in  tokenize(normalize-space(@target),'\s+') return starts-with($t,'#') and not(id(substring($t,2)))"/>
                        <report test="some $x in $results  satisfies $x"> Error: Every local pointer
                          in "<value-of select="@target"/>" must point to an ID in this document
                            (<value-of select="$results"/>)</report>
                      </rule>
                    </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-att.spanning-spanTo-spanTo-2-11">
          <rule context="tei:*[@spanTo]">
            <assert test="id(substring(@spanTo,2)) and following::*[@xml:id=substring(current()/@spanTo,2)]">
The element indicated by @spanTo (<value-of select="@spanTo"/>) must follow the current element <name/>
                  </assert>
          </rule>
        </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-att.styleDef-schemeVersion-schemeVersionRequiresScheme-12">
          <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_simplePrint-ab-abstractModel-structure-ab-13">
      <rule context="tei:ab">
         <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: ab may not occur inside paragraphs or other ab elements.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-ab-abstractModel-structure-l-14">
      <rule context="tei:ab">
         <report test="ancestor::tei:l or ancestor::tei:lg">
        Abstract model violation: Lines may not contain higher-level divisions such as p or ab.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-bibl-noEmptyBibl-15">
      <rule context="tei:bibl">
                  <assert test="child::* or child::text()[normalize-space()]" role="ERROR"> Element
                    "<name/>" may not be empty. </assert>
                </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-choice-choiceSize-16">
      <rule context="tei:choice">
                  <assert test="count(*) &gt; 1" role="ERROR"> Element "<name/>" must have at least two child elements.</assert>
                </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-choice-choiceContent-17">
      <rule context="tei:choice">
                  <assert test="(tei:corr or tei:sic or tei:expan or     tei:abbr or tei:reg or tei:orig) and ((tei:corr and tei:sic) or (tei:expan     and tei:abbr) or (tei:reg and tei:orig))"
                 role="ERROR"> Element "<name/>" must have corresponding corr/sic, expand/abbr,
                    reg/orig </assert>
                </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-desc-deprecationInfo-only-in-deprecated-18">
      <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_simplePrint-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_simplePrint-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_simplePrint-l-abstractModel-structure-l-21">
      <rule context="tei:l">
         <report test="ancestor::tei:l[not(.//tei:note//tei:l[. = current()])]">
        Abstract model violation: Lines may not contain lines or lg elements.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-lg-atleast1oflggapl-22">
      <rule context="tei:lg">
         <assert test="count(descendant::tei:lg|descendant::tei:l|descendant::tei:gap) &gt; 0">An lg element
        must contain at least one child l, lg, or gap element.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-lg-abstractModel-structure-l-23">
      <rule context="tei:lg">
         <report test="ancestor::tei:l[not(.//tei:note//tei:lg[. = current()])]">
        Abstract model violation: Lines may not contain line groups.
      </report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-list-gloss-list-must-have-labels-24">
      <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_simplePrint-p-abstractModel-structure-p-25">
      <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_simplePrint-p-abstractModel-structure-l-26">
      <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_simplePrint-pb-pbposition-27">
      <rule context="tei:pb">
                  <report test="parent::*/text() and not           (preceding-sibling::text() and           following-sibling::text())">please make sure pb elements are not at the start or end of mixed content
                  </report>
                </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-ref-refAtts-28">
      <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_simplePrint-relatedItem-targetorcontent1-29">
      <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_simplePrint-s-noNestedS-30">
      <rule context="tei:s">
         <report test="tei:s">You may not nest one s element within
      another: use seg instead</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-tei_simplePrint-subst-substContents1-31">
      <rule context="tei:subst">
         <assert test="child::tei:add and child::tei:del">
            <name/> must have at least one child add and at least one child del</assert>
      </rule>
   </pattern>
      
      
    
      
    <pattern id="schematron-constraint-tei_simplePrint-text-headeronlyelement-34">
                  
                  <rule context="tei:term | tei:biblFull ">
                    <report test="ancestor::tei:text">Error: The element <name/> is not permitted
                      outside the header</report>
                  </rule>
                </pattern>
</schema>
