<?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 2025-08-28T17:17:22Z by 'extract-isosch.xsl'. -->
   <!-- ********************* -->
   <!-- namespaces, declared: -->
   <!-- ********************* -->
   <ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
   <ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
   <ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
   <ns prefix="eg" uri="http://www.tei-c.org/ns/Examples"/>
   <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="rna" uri="http://relaxng.org/ns/compatibility/annotations/1.0"/>
   <ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
   <ns prefix="sch1x" uri="http://www.ascc.net/xml/schematron"/>
   <!-- ********************* -->
   <!-- namespaces, implicit: -->
   <!-- ********************* -->
   <ns prefix="teix" uri="http://www.tei-c.org/ns/Examples"/>
   <!-- ***** -->
   <!-- keys: -->
   <!-- ***** -->
   <key xmlns="http://www.w3.org/1999/XSL/Transform"
        name="idrefs"
        match="@target[starts-with(normalize-space(.), '#')]|@rendition[starts-with(normalize-space(.), '#')]"
        use="for $i in tokenize(., '\s+') return substring-after($i, '#')"/>
   <!-- ******************************************************* -->
   <!-- constraints in en, und, mul, zxx, of which there are 86 -->
   <!-- ******************************************************* -->
   <let name="double.quotes" value="'[&#34;“”]'"/>
   <let name="apos.typographic" value="'[‘’]'"/>
   <let name="apos.straight" value="''''"/>
   <let name="quotes" value="concat('[', $apos.straight, '&#34;]')"/>
   <let name="div.types.front"
        value="('abstract', 'acknowledgements', 'authorNotes', 'editorNotes', 'corrections', 'dedication')"/>
   <let name="tei.version.url"
        value="'https://jenkins.tei-c.org/job/TEIP5/lastStableBuild/artifact/P5/release/doc/tei-p5-doc/VERSION'"/>
   <let name="tei.version"
        value="if (unparsed-text-available($tei.version.url)) then normalize-space(unparsed-text($tei.version.url)) else ()"/>
   <pattern id="schematron-constraint-CMC_generatedBy_within_post-1">
      <rule context="tei:*[@generatedBy]">
         <assert test="ancestor-or-self::tei:post">The @generatedBy attribute is for use within a &lt;post&gt; element.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-att-datable-w3c-when-2">
      <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-att-datable-w3c-from-3">
      <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-att-datable-w3c-to-4">
      <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-only_1_ODD_source-5">
      <rule context="tei:*[@source]">
         <let name="srcs" value="tokenize( normalize-space(@source),' ')"/>
         <report test="(   self::tei:classRef                                 | self::tei:dataRef                                 | self::tei:elementRef                                 | self::tei:macroRef                                 | self::tei:moduleRef                                 | self::tei:schemaSpec )                                   and                                   $srcs[2]"> When used on a schema description element (like <value-of select="name(.)"/>), the @source attribute should have only 1 value. (This one has <value-of select="count($srcs)"/>.)</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-targetLang-6">
      <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-schemeVersionRequiresScheme-7">
      <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-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-abstractModel-structure-p-in-ab-or-p-9">
      <rule context="tei:p">
         <report test="(ancestor::tei:ab or ancestor::tei:p) and                        not( ancestor::tei:floatingText                           | 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-abstractModel-structure-p-in-l-10">
      <rule context="tei:l//tei:p">
         <assert test="ancestor::tei:floatingText | parent::tei:figure | parent::tei:note"> Abstract model violation: Metrical lines may not contain higher-level structural elements such as div, p, or ab, unless p is a child of figure or note, or is a descendant of floatingText.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-core-11">
      <rule context="tei:quote">
         <assert see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#quotations"
                 test="id(substring-after(@source, '#'))/(self::tei:ref[@type eq 'bibl']|self::tei:bibl[ancestor::tei:body])">
            <name/> must have a @source that points to the @xml:id of either a ref[type='bibl'], or a &lt;bibl&gt; in the &lt;body&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-cit-12">
      <rule context="tei:cit" role="warning">
         <assert test="tei:ref"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#quotations">
            <name/> is normally expected to have a bibliographic reference (ref[@type="bibl"]). Please make sure you intended not to add one here.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-deprecationInfo-only-in-deprecated-13">
      <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-jtei.sch-gap-14">
      <rule context="tei:gap">
         <report test="following-sibling::node()[1][self::text()] and starts-with(following-sibling::node()[1], '.')"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#inline_rhetorical"> A <name/> element should follow a period rather than precede it when an ellipsis follows the end of a sentence.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-gap-ws-15">
      <rule context="tei:gap">
         <report test="preceding-sibling::node()[1][self::text()][matches(., '\.\s+$')]"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#inline_rhetorical"> A <name/> should follow a period directly, without preceding whitespace.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-ptr-multipleTargets-16">
      <rule context="tei:ptr[not(@type='crossref')]">
         <report test="count(tokenize(normalize-space(@target), '\s+')) &gt; 1"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#internal_linking"> Multiple values in @target are only allowed for <name/>[@type='crossref'].</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-ptrAtts-17">
      <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-jtei.sch-ref-multipleTargets-18">
      <rule context="tei:ref">
         <report test="count(tokenize(normalize-space(@target), '\s+')) &gt; 1"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#external_linking">
            <name/> with multiple values for @target is not supported.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-biblref-parentheses-19">
      <rule context="tei:ref[@type eq 'bibl']">
         <assert test="not(matches(., '^\(.*\)$'))"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#internal_linking"> Parentheses are not part of bibliographic references. Please move them out of <name/>.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-biblref-target-20">
      <rule context="tei:ref[@type eq 'bibl']">
         <assert test="id(substring-after(@target, '#'))/(self::tei:bibl|self::tei:person[ancestor::tei:particDesc/parent::tei:profileDesc])"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#internal_linking"> A bibliographic reference must point with a @target to the @xml:id of an entry in the div[@type="bibliography"].</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-biblref-type-21">
      <rule context="tei:ref[id(substring-after(@target, '#'))/self::tei:bibl]">
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="@type eq 'bibl'"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#internal_linking"
                 sqf:fix="bibltype.add"> A bibliographic reference must be typed as @type="bibl".</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-refAtts-22">
      <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-gloss-list-must-have-labels-23">
      <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-jtei.sch-head-number-24">
      <rule context="tei:head">
         <report test="matches(., '^\s*(((figure|fig\.|table|example|ex\.|section) )\d|\d+\.\d?)', 'i')"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#body"> Headings are numbered and labeled automatically, please remove the hard-coded label from the text.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-figure-head-25">
      <rule context="tei:figure/tei:head">
         <assert test="@type = ('legend', 'license')"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#figures"> Figure titles (&lt;head&gt;) must have a type 'legend' or 'license'.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-note-punctuation-26">
      <rule context="tei:note">
         <assert test="not(following::text()[not(ancestor::tei:note)][1][matches(., '^[,\.:;!?\]]')])"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#footnotes"> Footnotes should follow punctuation marks, not precede them. Place your &lt;<name/>&gt; element after the punctuation mark.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-note-punctuation-27">
      <rule context="tei:note">
         <report test="preceding::text()[not(ancestor::tei:note)][1][matches(., '—$')]"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#footnotes"> Footnotes should precede the dash, not follow it. Place your &lt;<name/>&gt; element before the dash.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-note-punctuation-28">
      <rule context="tei:note" role="warning">
         <report test="following::text()[not(ancestor::tei:note)][1][matches(normalize-space(), '^\)')]"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#footnotes"> Footnotes may be placed before closing parentheses, though this is exceptional. Please check if this note's placement is correct. Otherwise, move it after the closing parenthesis.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-note-punctuation-29">
      <rule context="tei:note" role="warning">
         <report test="descendant::node()[last()][                   not(matches(normalize-space(), '(^|[^.?!:;,])[.?!]$')) or                   preceding-sibling::node()[1]/descendant-or-self::*[last()]                       [matches(normalize-space(), '[.?!:;,]$')]                       ]"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#footnotes"> A footnote should end a with a single closing punctuation character.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-note-blocks-30">
      <rule context="tei:note">
         <report test=".//(tei:cit|tei:table|tei:list[not(tokenize(@rend, '\s+')[. eq 'inline'])]|tei:figure|eg:egXML|tei:eg)"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#footnotes"> No block-level elements (&lt;cit&gt;, &lt;table&gt;, &lt;figure&gt;, &lt;egXML&gt;, &lt;eg&gt;, &lt;list&gt; which do not have the value inline for @rend) are allowed inside <name/>.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-graphic-dimensions-31">
      <rule context="tei:graphic">
         <assert test="matches(@width, '\d+px') and matches(@height, '\d+px')"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#figures"> Width and height in pixels must be specified for any <name/>.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-graphic-context-32">
      <rule context="tei:graphic">
         <assert test="parent::tei:figure"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#figures">
            <name/> may only occur inside &lt;figure&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-author-33">
      <rule context="tei:titleStmt/tei:author">
         <assert test="tei:name and tei:affiliation and tei:email"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#structure"> Author information in the &lt;titleStmt&gt; must include &lt;name&gt;, &lt;affiliation&gt; and &lt;email&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-respSmt-34">
      <rule context="tei:respStmt">
         <assert test="ancestor::tei:sourceDesc">
            <name/> can only be used in the context of sourceDesc.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-bibl-id-35">
      <rule context="tei:back/tei:div[@type eq 'bibliography']//tei:bibl"
            see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back"
            role="warning">
         <assert test="@xml:id"> A bibliographic entry should have a unique value for @xml:id.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-bibl-orphan-36">
      <rule context="tei:back/tei:div[@type eq 'bibliography']//tei:bibl"
            role="warning">
         <assert test="key('idrefs', @xml:id)/parent::tei:ref[@type='bibl']"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back"> This bibliographic entry is an orphan: no ref[@type="bibl"] references to it occur in the text.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-bibl-endpunctuation-37">
      <rule context="tei:back/tei:div[@type eq 'bibliography']//tei:bibl"
            see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back"
            role="warning">
         <report test="descendant::node()[last()][                     not(matches(normalize-space(), '(^|[^.?!:;,])\.$')) or                     preceding-sibling::node()[1]/descendant-or-self::*[last()]                       [matches(normalize-space(), '[.?!:;,]$')]                     ]"> A bibliographic entry should end with a single period.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-title-journal-CMOS-38">
      <rule context="tei:bibl/tei:title[@level='j']" role="warning">
         <report test="self::*[preceding-sibling::*[1]/self::tei:title[@level='a']]                     [not(preceding-sibling::node()[normalize-space()][1][matches(normalize-space(), '[.,!?]$')])]                     "
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back"> An analytic title and a journal title in a bibliographic entry should only be separated by a comma or a period (or the end punctuation of the analytic title).</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-table-39">
      <rule context="tei:table">
         <assert test="not(ancestor::tei:list)"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#lists"> No tables are allowed inside lists.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-title-40">
      <rule context="tei:titleStmt">
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="tei:title[@type = 'main']"
                 sqf:fix="type.add"> A title of type "main" is required in <name/>.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-doi-order-41">
      <rule context="tei:back/tei:div[@type eq 'bibliography']//tei:idno[@type eq 'doi']">
         <report test="following-sibling::tei:ref"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back"> If a bibliographic entry has a formal DOI code, it should be placed at the very end of the bibliographic description.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-rendition-42">
      <rule context="tei:rendition">
         <assert test="key('idrefs', @xml:id)[. instance of attribute(rendition)]"> Please remove all <name/> definitions that aren't actually being used in the article.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-att-43">
      <rule context="tei:att">
         <assert test="not(matches(., '^@'))"> Attribute delimiters are not allowed for <name/>: they are completed at processing time via XSLT.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-tag-44">
      <rule context="tei:tag">
         <assert test="not(matches(., '^[&lt;!?-]|[&gt;/?\-]$'))"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#inline_technical"> Tag delimiters such as angle brackets and tag-closing slashes are not allowed for <name/>: they are completed at processing time via XSLT.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-val-45">
      <rule context="tei:val">
         <assert test="not(matches(., concat('^', $quotes, '|', $quotes, '$')))"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#inline_technical"> Attribute value delimiters are not allowed for <name/>: they are completed at processing time via XSLT.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-article-keywords-46">
      <rule context="tei:text[not(tei:body/tei:div[@type = ('editorialIntroduction')])]">
         <assert test="parent::tei:TEI/tei:teiHeader/tei:profileDesc/tei:textClass/tei:keywords"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#header"> An article must have a keyword list in the header. This should be a list of &lt;term&gt; elements in TEI/teiHeader/profileDesc/textClass/keywords</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-article-abstract-47">
      <rule context="tei:text[not(tei:body/tei:div[@type = ('editorialIntroduction')])]">
         <assert test="tei:front/tei:div[@type='abstract']"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#front"> An article must have a front section with an abstract (div[@type='abstract']).</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-article-back-48">
      <rule context="tei:text[not(tei:body/tei:div[@type = ('editorialIntroduction')])]">
         <assert test="tei:back/tei:div[@type='bibliography']/tei:listBibl"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back"> An article must have a back section with a bibliography (div[@type='bibliography']).</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-body-49">
      <rule context="tei:body[child::tei:div[not(@type=('editorialIntroduction'))]]">
         <assert test="count(child::tei:div) gt 1"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#body"> If <name/> contains a div, and that div is not an editorial introduction, then there should be more than one div. Rather than using only a single div, you may place the content directly in the <name/> element.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-divtypes-front-50">
      <rule context="tei:div[@type = $div.types.front]">
         <assert test="parent::tei:front"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#front"> A text division of type <value-of select="@type"/> may only occur inside &lt;front&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-divtypes-front2-51">
      <rule context="tei:front/tei:div">
         <assert test="@type = $div.types.front"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#front"> Only text divisions of type <value-of select="string-join(for $i in $div.types.front return concat(if (index-of($div.types.front, $i) = count($div.types.front)) then 'or ' else (), '&#34;', $i, '&#34;'), ', ')"/> may appear in the &lt;front&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-divtypes-back-52">
      <rule context="tei:div[@type = ('bibliography', 'appendix')]"
            see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back">
         <assert test="parent::tei:back"> Bibliography (<name/>[@type="bibliography"]) and appendices (<name/>[@type="appendix"]) may only occur inside &lt;back&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-divtypes-body-53">
      <rule context="tei:div[@type = ('editorialIntroduction')]">
         <assert test="parent::tei:body"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#body"> An editorial introduction (<name/>[@type="editorialIntroduction"]) may only occur inside &lt;body&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-div-head-54">
      <rule context="tei:body//tei:div[not(@type = ('editorialIntroduction'))]">
         <assert test="tei:head"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#divs"> A <name/> must contain a &lt;head&gt;.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-abstractModel-structure-div-in-l-55">
      <rule context="tei:l//tei:div">
         <assert test="ancestor::tei:floatingText"> Abstract model violation: Metrical lines may not contain higher-level structural elements such as div, unless div is a descendant of floatingText.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-abstractModel-structure-div-in-ab-or-p-56">
      <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, unless div is a descendant of floatingText.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-front-abstract-57">
      <rule context="tei:front">
         <assert test="tei:div[@type='abstract']"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#front">
            <name/> must have an abstract (div[@type='abstract']).</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-back-58">
      <rule context="tei:back">
         <assert test="tei:div[@type='bibliography']/tei:listBibl"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#back">
            <name/> must have a bibliography (div[@type="bibliography"]), which must be organized inside a &lt;listBibl&gt; element.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-supplied-59">
      <rule context="tei:supplied">
         <assert test="not(matches(., '^\[|\]$'))"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#inline_rhetorical"> Please remove square brackets from <name/>: they are completed at processing time via XSLT.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-straightApos-60">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag|ancestor::tei:mentioned)]">
         <report xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="matches(., $apos.straight)"
                 sqf:fix="apostrophe.replace"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#faq"> "Straight apostrophe" characters are not permitted. Please use the Right Single Quotation Mark (U+2019 or ’) character instead. On the other hand, if the straight apostrophe characters function as quotation marks, please replace them with appropriate mark-up that will ensure the appropriate quotation marks will be generated consistently.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-LRquotes-61">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag)][matches(., $apos.typographic)]"
            role="warning">
         <report test="matches(., '\W[’]\D') or matches(., '[‘](\W|$)') or matches(., '\w[‘]\w')"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#faq"> Left and Right Single Quotation Marks should be used in the right place. Please check their placement in this text node.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-quotationMarks-62">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag)]">
         <report test="matches(., $double.quotes) or matches(., '(^|\W)[‘][^‘’]+[’](\W|$)')"
                 see="https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_jtei.doc.html#faq"> Quotation marks are not permitted in plain text. Please use appropriate mark-up that will ensure the appropriate quotation marks will be generated consistently.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-doubleHyphens-63">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag|ancestor::tei:ref)]">
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="not(contains(., '--'))"
                 sqf:fix="dash.replace"> Double hyphens should not be used for dashes. Please use the EM Dash (U+2014 or —) instead.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-rangeHyphen-64">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag|ancestor::tei:idno|ancestor::tei:date)]">
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="not(matches(., '(^|[\W-[-]])\d+-\d+([\W-[-]]|$)'))"
                 sqf:fix="hyphen.replace"> Numeric ranges should not be indicated with a hyphen. Please use the EN Dash (U+2013 or –) character instead.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-ieEg-65">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag)]">
         <report xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="matches(., '(i\.e\.|e\.g\.)[^,]', 'i')"
                 sqf:fix="comma.add"> You should put a comma after "i.e." and "e.g.".</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-nonbreakingspace-66">
      <rule role="warning"
            context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag)]">
         <report xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="matches(., ' ')"
                 sqf:fix="nonbreakingspace.remove"> This text contains a non-breaking space character. Please consider changing this to a normal space character.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-localLinkTarget-67">
      <rule context="@*[self::attribute(corresp)|self::attribute(target)|self::attribute(from)|self::attribute(to)|self::attribute(ref)|self::attribute(rendition)|self::attribute(resp)|self::attribute(source)][not(ancestor::eg:egXML)][some $i in tokenize(., '\s+') satisfies starts-with($i, '#')]">
         <let name="orphan.pointers"
              value="for $p in tokenize(., '\s+')[starts-with(., '#')] return if (not(id(substring-after($p, '#')))) then $p else ()"/>
         <report test="exists($orphan.pointers)"> There's no local target for <value-of select="if (count($orphan.pointers) &gt; 1) then 'these pointers' else 'this pointer'"/>: <value-of select="string-join($orphan.pointers, ', ')"/>. Please make sure you're referring to an existing @xml:id value.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-renditionTarget-68">
      <rule context="@rendition">
         <let name="orphan.pointers"
              value="for $p in tokenize(., '\s+')[starts-with(., '#')] return for $id in id(substring-after($p, '#'))[not(self::tei:rendition)] return $p"/>
         <report test="exists($orphan.pointers)">
            <value-of select="if (count($orphan.pointers) &gt; 1) then 'These pointers don''t' else 'This pointer doesn''t'"/> point to a &lt;rendition&gt; target: <value-of select="string-join($orphan.pointers, ', ')"/>.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-quoteDelim-69">
      <rule context="tei:title[@level eq 'a']|tei:mentioned|tei:soCalled|tei:quote|tei:q">
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="not(matches(., concat('^', $double.quotes, '|', $double.quotes, '$')))"
                 sqf:fix="quotation.remove"> Quotation mark delimiters are not allowed for <name/>: they are completed at processing time via XSLT.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-crossref-id-70">
      <rule context="tei:body//tei:div[not(@type='editorialIntroduction')]|tei:figure|tei:table"
            role="warning">
         <assert test="@xml:id"> You're strongly advised to add an @xml:id attribute to <name/> to ease formal cross-referencing with (ptr|ref)[@type='crossref']</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-formalCrossref-71">
      <rule context="text()[not(ancestor::tei:eg|ancestor::eg:egXML|ancestor::tei:code|ancestor::tei:tag|ancestor::tei:ref[not(@type='crossref')])]"
            role="warning">
         <assert test="not(matches(., '(table|figure|example|section) \d+([.,]\d+)* ((above)|(below))', 'i'))"> Please replace literal references to tables, figures, examples, and sections with a formal crosslink: (ptr|ref)[@type="crossref"]</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-crossrefTargetType-72">
      <rule context="tei:ptr[@type='crossref']|tei:ref[@type='crossref']">
         <let name="orphan.pointers"
              value="for $p in tokenize(@target, '\s+')[starts-with(., '#')] return for $id in id(substring-after($p, '#'))[not(self::tei:div or self::tei:figure or self::tei:table or self::tei:note)] return $p"/>
         <report test="exists($orphan.pointers)"> Cross-links (<name/>[@type="crossref"]) should be targeted at &lt;div&gt;, &lt;figure&gt;, &lt;table&gt;, or &lt;note&gt; elements. The target of <value-of select="if (count($orphan.pointers) &gt; 1) then 'these pointers' else 'this pointer'"/> doesn't satisfy this condition: <value-of select="string-join($orphan.pointers, ', ')"/>.</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-crossrefType-73">
      <rule context="tei:ptr[not(@type='crossref')]|tei:ref[not(@type='crossref')]">
         <report xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="id(substring-after(@target, '#'))/(self::tei:div|self::tei:figure|self::tei:table)"
                 sqf:fix="crossreftype.add"> Please type internal cross-references as 'crossref' (<name/>[@type="crossref"]).</report>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-centuries-74">
      <rule context="text()[not(ancestor::tei:quote or ancestor::tei:title)]">
         <assert test="not(matches(., '\d\d?((th)|(st)|(rd)|(nd))[- ]centur((y)|(ies))', 'i'))"> Centuries such as "the nineteenth century" should be spelled out, not written with digits.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.sch-teiVersion-75">
      <rule context="@target[matches(., '^https?://(www\.)?tei-c\.org/release/doc/tei-p5-doc')]">
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="false()"
                 sqf:fix="teiURL.fix"> Please refer to the exact version of the TEI Guidelines<value-of select="if (normalize-space($tei.version)) then concat(' (currently at version ', $tei.version, ')') else ()"/>, and link to the version that can be found in the Vault section. For an overview of all archived versions, see https://www.tei-c.org/Vault/P5/. If you're referring to the English version, the correct URL will likely take the form of https://www.tei-c.org/Vault/P5/{$version-number}/doc/tei-p5-doc/en/html/.</assert>
      </rule>
   </pattern>
   <pattern id="schematron-constraint-jtei.jtei-url-76">
      <rule context="@target[matches(., '^https?://(www\.)?jtei\.revues\.org/?')]"
            role="warning">
         <let name="URL.fixed"
              value="replace(., '^https?://(www\.)?jtei\.revues\.org/?', 'https://journals.openedition.org/jtei/')"/>
         <assert xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
                 test="false()"
                 sqf:fix="jteiURL.fix"> Please refer to the correct jTEI URL: <value-of select="$URL.fixed"/>.</assert>
      </rule>
   </pattern>
</schema>
