<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0"
     xmlns:rng="http://relaxng.org/ns/structure/1.0"
     xmlns:sch="http://purl.oclc.org/dsdl/schematron"
     xml:lang="en" n="detest">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Testing errors</title>
        <author>Lou Burnard</author>
        <author>Sebastian Rhatz</author>
        <author xml:id="sbauman.emt">Syd Bauman</author>
      </titleStmt>
      <publicationStmt>
        <p>Published along with TEI P5 as part of its build process test suite</p>
      </publicationStmt>
      <sourceDesc>
        <p>authored from scratch</p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <change when="2024-10-29" who="#sbauman.emt">
	Added <att>xml:lang</att> to every <gi>constraintSpec</gi>
      </change>
      <change when="2024-03-13" who="#sbauman.emt">
        Add specifications for several new elements
        (<gi>no_duplicate_attrs_1_invalid</gi>,
        <gi>no_duplicate_attrs_2_valid</gi>,
        <gi>no_duplicate_attrs_3_invalid</gi>, and
        <gi>no_duplicate_attrs_4_invalid</gi>) that exercise the new
        <name>no_duplicate_attrs</name> constraint.
      </change>
      <change when="2023-08-06" who="#sbauman.emt">
        Add the <name>add_missing_scheme</name> and
        <name>replace_missing_scheme</name> tests for
        <gi>constraintSpec</gi>.
      </change>
      <change when="2022-04-04" who="#sbauman.emt">
        <list>
          <item>Tweaked some comments and wording of content</item>
          <item>Added tests for <gi>listRef</gi> inside *Spec elements</item>
        </list>
      </change>
      <change when="2021-08-20" who="#sbauman.emt">
        <list>
          <item>Inserted test material created by EBB for checking abstract model constraints</item>
          <item>Added <name type="module">figures</name>, because above uses <gi>figure</gi></item>
          <item>Changed heading of <gi>div</gi> that contans the
          schema specification because it is not remotely minimal any
          more</item>
          <item>Added <att>xml:lang</att> and <att>versionDate</att>
          attributes to some <gi>gloss</gi> and <gi>desc</gi>
          elements.</item>
        </list>
      </change>      
      <change when="2016-11-06" who="#sbauman.emt">
        Added <gi>elementSpec</gi> for <gi>blort3</gi> in order to test
        deprecation of <val>isoschematron</val>. (Note: this change begun
        during TEI Council meeting in Vienna.)
      </change>
      <change when="2015-03-27" who="#sbauman.emt">
        Added an element specification to test constraints on
        <gi>defaultVal</gi>
      </change>
      <change when="2014-09-10" who="#sbauman.emt">
        Added <name type="module">msdescription</name> and
        <name type="module">tagdocs</name>
      </change>
    </revisionDesc>
  </teiHeader>
  <text>
    <body>
      <div>
        <head>A Test Schema</head>
        <p>Here is the introduction to your document</p>
        <specGrp xml:id="limit_attrs_on_elementRef">
          <elementRef key="p" minOccurs="2" maxOccurs="4">
            <!-- Should be flagged as an error: @m[ia][nx]Occurs not allowed here -->
          </elementRef>
          <elementRef key="charName" source="tei:3.5.0"/>
        </specGrp>
        <p>Here is the schema:</p>
        <schemaSpec ident="detest" start="TEI">
          <moduleRef key="header"/>
          <moduleRef key="core"/>
          <moduleRef key="tei"/>
	  <moduleRef key="cmc"/>
          <moduleRef key="textstructure"/>
          <moduleRef key="analysis"/>
          <moduleRef key="textcrit"/>
          <moduleRef key="transcr"/>
          <moduleRef key="linking"/>
          <moduleRef key="msdescription"/>
          <moduleRef key="tagdocs"/>
          <moduleRef key="spoken"/>
          <moduleRef key="figures"/>
          <elementSpec ident="p" mode="change">
            <constraintSpec mode="add" ident="c1" scheme="schematron" xml:lang="en">
              <constraint>
                <sch:rule context="p">
                  <sch:report test="tei:list"> 
                    lists inside paragraphs not supported
                  </sch:report>
                </sch:rule>
              </constraint>
            </constraintSpec>
            <constraintSpec mode="add" ident="c2" scheme="schematron" xml:lang="en">
              <constraint>
                <sch:rule context="tei:p|tei:q">
                  <sch:report test="contains(@rend,' ')"> multi-valued rend is not supported </sch:report>
                </sch:rule>
              </constraint>
            </constraintSpec>
            <attList>
              <attDef ident="rend" mode="change">
                <valList type="closed" mode="add">
                  <valItem ident="center"/>
                  <valItem ident="boxed"/>
                </valList>
              </attDef>
              <attDef ident="type" mode="change">
                <datatype>
                  <dataRef name="float"/>
                </datatype>
                <remarks versionDate="2026-06-30" xml:lang="en">
                  <p>This <gi>remarks</gi> element is here for the
                  sole purpose of testing the warning or error msg
                  that is produced when a <gi>remarks</gi> element
                  does NOT have an <att>ident</att>.</p>
                </remarks>
              </attDef>
            </attList>
          </elementSpec>
          <elementSpec ident="distinct" mode="change" module="core">
            <attList>
              <!-- min=0 max=1,2,* -->
              <attDef ident="o01" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 0, max 1</gloss>
                <datatype minOccurs="0" maxOccurs="1">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <attDef ident="o02" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 0, max 2</gloss>
                <datatype minOccurs="0" maxOccurs="2">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <attDef ident="o0i" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 0, max unbounded</gloss>
                <datatype minOccurs="0" maxOccurs="unbounded">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <!-- min=1 max=1,2,* -->
              <attDef ident="o11" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 1, max 1</gloss>
                <datatype minOccurs="1" maxOccurs="1">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <attDef ident="o12" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 1, max 2</gloss>
                <datatype minOccurs="1" maxOccurs="2">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <attDef ident="o1i" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 1, max unbounded</gloss>
                <datatype minOccurs="1" maxOccurs="unbounded">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <!-- min=2 max=2,* -->
              <attDef ident="o22" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 2, max 2</gloss>
                <datatype minOccurs="2" maxOccurs="2">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
              <attDef ident="o2i" usage="opt">
                <gloss  xml:lang="en" versionDate="2014-01-12">optional, min 2, max unbounded</gloss>
                <datatype minOccurs="2" maxOccurs="unbounded">
                  <dataRef key="teidata.count"/>
                </datatype>
              </attDef>
            </attList>
          </elementSpec>
          <elementSpec ident="div" mode="change">
            <constraintSpec mode="add" ident="canondiv" scheme="schematron" xml:lang="en">
              <constraint>
                <sch:rule context="tei:div">
                  <sch:report test="@type eq 'canon'  and  parent::tei:div/@type eq 'canon'">
                    divs of type 'canon' may not be nested
                  </sch:report>
                  <sch:report test="@type eq 'canon'  and  parent::tei:div/@type eq 'register'">
                    divs of type 'canon' may not be nested within 'register'
                  </sch:report>
                  <sch:report test="@type eq 'canon'  and  count( tei:div[ @type eq 'canonText'] ) gt 1">
                    divs of type 'canon' may contain only one 'canonText'
                  </sch:report>
                  <sch:report test="@type eq 'canonText'  and  not( parent::tei:div[ @type eq 'canon'] )">
                    divs of type 'canonText' can only occur inside 'canon'
                  </sch:report>
                </sch:rule>
              </constraint>
            </constraintSpec>
          </elementSpec>
          <elementSpec ident="lg" mode="change">
            <content>
              <group xmlns="http://relaxng.org/ns/structure/1.0">
                <zeroOrMore>
                  <choice>
                    <ref name="model.divTop"/>
                    <ref name="model.global"/>
                  </choice>
                </zeroOrMore>
                <choice>
                  <ref name="model.lLike_sequence"/>
                  <ref name="model.stageLike"/>
                  <ref name="model.labelLike"/>
                  <ref name="lg"/>
                </choice>
                <zeroOrMore>
                  <choice>
                    <ref name="model.lLike_sequence"/>
                    <ref name="model.stageLike"/>
                    <ref name="model.labelLike"/>
                    <ref name="model.global"/>
                    <ref name="lg"/>
                  </choice>
                </zeroOrMore>
                <zeroOrMore>
                  <group>
                    <ref name="model.divBottom"/>
                  </group>
                  <zeroOrMore>
                    <ref name="model.global"/>
                  </zeroOrMore>
                </zeroOrMore>
              </group>
            </content>
          </elementSpec>
          <elementSpec ident="l" mode="change">
            <classes mode="replace">
	      <!-- This should fire an error becase "att.metrical", "att.enjamb",
		   and "model.lLike" are not in alphabetical order. -->
              <memberOf key="att.global"/>
              <memberOf key="att.metrical"/>
              <memberOf key="att.enjamb"/>
              <memberOf key="model.lLike" min="2" max="6"/>
            </classes>
          </elementSpec>
          <elementSpec ident="blort" mode="add">
            <desc  xml:lang="en" versionDate="2014-01-12">a completely spurious element made up for testing purposes only</desc>
            <classes>
              <memberOf key="model.pPart.data"/>
            </classes>
            <content>
              <macroRef key="macro.phraseSeq"/>
            </content>
            <attList>
              <attDef ident="cert">
                <desc xml:lang="en" versionDate="2014-01-12">certainty</desc>
                <datatype>
                  <dataRef key="teidata.certainty"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="code">
                <desc xml:lang="en" versionDate="2014-01-12">code</desc>
                <datatype>
                  <dataRef key="teidata.code"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="dur">
                <desc xml:lang="en" versionDate="2014-01-12">duration</desc>
                <datatype>
                  <dataRef key="teidata.duration.w3c"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="enumerated">
                <desc xml:lang="en" versionDate="2014-01-12">enumerated</desc>
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="key">
                <desc xml:lang="en" versionDate="2014-01-12">key</desc>
                <datatype>
                  <dataRef key="teidata.key"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="count">
                <desc xml:lang="en" versionDate="2014-01-12">count</desc>
                <datatype>
                  <dataRef key="teidata.count"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="language">
                <desc xml:lang="en" versionDate="2014-01-12">language</desc>
                <datatype>
                  <dataRef key="teidata.language"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="name">
                <desc xml:lang="en" versionDate="2014-01-12">name</desc>
                <datatype>
                  <dataRef key="teidata.name"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="names">
                <desc xml:lang="en" versionDate="2014-01-12">names</desc>
                <datatype maxOccurs="unbounded">
                  <dataRef key="teidata.name"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="pattern">
                <desc xml:lang="en" versionDate="2014-01-12">pattern</desc>
                <datatype>
                  <dataRef key="teidata.pattern"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="numeric">
                <desc xml:lang="en" versionDate="2014-01-12">numeric</desc>
                <datatype>
                  <dataRef key="teidata.numeric"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="pointer">
                <desc xml:lang="en" versionDate="2014-01-12">pointer</desc>
                <datatype>
                  <dataRef key="teidata.pointer"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="pointers">
                <desc xml:lang="en" versionDate="2014-01-12">pointers</desc>
                <datatype maxOccurs="unbounded">
                  <dataRef key="teidata.pointer"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="prob">
                <desc xml:lang="en" versionDate="2014-01-12">probability</desc>
                <datatype>
                  <dataRef key="teidata.probability"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="sex">
                <desc xml:lang="en" versionDate="2014-01-12">sex</desc>
                <datatype>
                  <dataRef key="teidata.sex"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="temporal">
                <desc xml:lang="en" versionDate="2014-01-12">temporal</desc>
                <datatype>
                  <dataRef key="teidata.temporal.w3c"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="truth">
                <desc xml:lang="en" versionDate="2014-01-12">truth</desc>
                <datatype>
                  <dataRef key="teidata.truthValue"/>
                </datatype>
                <valDesc/>
              </attDef>
              <attDef ident="xtruth">
                <desc xml:lang="en" versionDate="2014-01-12">xtruth</desc>
                <datatype>
                  <dataRef key="teidata.xTruthValue"/>
                </datatype>
                <valDesc/>
              </attDef>
            </attList>
          </elementSpec>
          <elementSpec ident="blort2" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="model.pPart.data"/>
            </classes>
            <content>
              <macroRef key="macro.phraseSeq"/>
            </content>
            <attList>
              <attDef ident="default-is-in-list-opt" usage="opt">
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <defaultVal>ONE</defaultVal>
                <valList mode="add" type="closed">
                  <valItem ident="ONE"/>
                  <valItem ident="TWO"/>
                  <valItem ident="THREE"/>
                </valList>
              </attDef>
              <attDef ident="default-is-in-list-rec" usage="rec">
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <defaultVal>ONE</defaultVal>
                <valList mode="add" type="closed">
                  <valItem ident="ONE"/>
                  <valItem ident="TWO"/>
                  <valItem ident="THREE"/>
                </valList>
              </attDef>
              <attDef ident="default-is-in-list-req" usage="req">
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <defaultVal>ONE</defaultVal>
                <valList mode="add" type="closed">
                  <valItem ident="ONE"/>
                  <valItem ident="TWO"/>
                  <valItem ident="THREE"/>
                </valList>
              </attDef>
              <attDef ident="default-NOT-in-list-opt" usage="opt">
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <defaultVal>ONE</defaultVal>
                <valList mode="add" type="closed">
                  <valItem ident="TWO"/>
                  <valItem ident="THREE"/>
                </valList>
              </attDef>
              <attDef ident="default-NOT-in-list-rec" usage="rec">
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <defaultVal>ONE</defaultVal>
                <valList mode="add" type="closed">
                  <valItem ident="TWO"/>
                  <valItem ident="THREE"/>
                </valList>
              </attDef>
              <attDef ident="default-NOT-in-list-req" usage="req">
                <datatype>
                  <dataRef key="teidata.enumerated"/>
                </datatype>
                <defaultVal>ONE</defaultVal>
                <valList mode="add" type="closed">
                  <valItem ident="TWO"/>
                  <valItem ident="THREE"/>
                </valList>
              </attDef>
            </attList>
            <remarks ident="blort2-remarks" xml:lang="en">
              <p>This element tests schematron constraints that try to
              ensure the saneness of <gi>defaultVal</gi></p>
            </remarks>
          </elementSpec>
          <elementSpec ident="blort3" mode="add">
            <desc xml:lang="en" versionDate="2016-09-27">another completely spurious element made up for testing purposes only</desc>
            <classes>
              <memberOf key="model.pPart.data"/>
            </classes>
            <content>
              <rng:ref name="macro.phraseSeq"/>
            </content>
            <constraintSpec ident="add_missing_scheme" xml:lang="en">
              <desc>This <gi>constraintSpec</gi> is invalid because it is
              missing <att>scheme</att> in <val>add</val> mode.</desc>
              <constraint>
                <sch:report test="false()">This rule never fires, 01</sch:report>
              </constraint>
            </constraintSpec>
            <constraintSpec ident="replace_missing_scheme" mode="replace" xml:lang="en">
              <desc>This <gi>constraintSpec</gi> is invalid because it is
              missing <att>scheme</att> in <val>replace</val> mode.</desc>
              <constraint>
                <sch:report test="false()">This rule never fires, 02.</sch:report>
              </constraint>
            </constraintSpec>
            <constraintSpec ident="test_contextless_report" scheme="schematron" xml:lang="en">
              <desc>This <gi>constraintSpec</gi> is invalid because it
              has an <gi>sch:report</gi> that does not have a context
              (i.e., does not have a <tag>sch:rule
              context="…"</tag>.)</desc>
              <constraint>
                <sch:report test="false()">This rule never fires, 03.</sch:report>
              </constraint>
            </constraintSpec>
            <!--
                * The following <constraintSpec>s have an @ident that
                * is of the form
                * "@scheme_content-language_expected-result",
                * where:
                *   @scheme = the value of ../@scheme
                *   content-language = whether ../* are Schematron 1.x ("schematron") or ISO Schematron elements
                *   expected-result = OK, deprecated, or error
            -->
            <constraintSpec scheme="schematron" ident="schematron_isoschematron_OK" xml:lang="en">
              <!-- This should *not* raise an error, as ISO Schematron
                   is allowed inside constraintSpec/schematron -->
              <constraint>
                <sch:rule context="*">
                  <sch:assert test="true()"/>
                </sch:rule>
              </constraint>
            </constraintSpec>
            <constraintSpec scheme="isoschematron" ident="isoschematron_isoschematron_error" xml:lang="en">
              <!-- This should raise an error now, as "isoschematron"
                   is no longer allowed. -->
              <constraint>
                <sch:rule context="*">
                  <sch:assert test="true()"/>
                </sch:rule>
              </constraint>
            </constraintSpec>
          </elementSpec>

          <elementSpec ident="relation" mode="change">
            <constraintSpec ident="activepassive" mode="delete" scheme="schematron" xml:lang="en"/>
          </elementSpec>

          <elementSpec ident="abbr" mode="change">
            <!-- missing @versionDate: -->
            <gloss xml:lang="en">change of abbr for the sake of change (element gloss)</gloss>
            <!-- missing @xml:lang: -->
            <desc versionDate="2022-04-04">change of abbr for the sake of change (element desc)</desc>
            <attList>
              <attDef ident="type" mode="change">
                <!-- missing both @versionDate and @xml:lang: -->
                <gloss>change of type for the sake of change (attr gloss)</gloss>
                <!-- missing neither @versionDate nor @xml:lang:-->
                <desc xml:lang="en" versionDate="2022-04-04">change of type for the sake of change (attr desc)</desc>
              </attDef>
            </attList>
            <remarks ident="abbr-remarks" xml:lang="en"><p>change of abbr for the sake of change (remarks)</p></remarks>
            <listRef>
              <ref type="invalid" n="1">no target (2B caught by Schematron)</ref>
              <ref type="valid" n="2" target="https://www.example.edu/tst">good target absolute URI</ref>
              <ref type="valid" n="3" target="#one">good target shorthand pointer</ref>
              <ref type="invalid" n="4" target="#one #two">bad target, two pointers (2B caught by Schematron)</ref>
              <!-- Following canont be included because invalidity would break the testing process: -->
              <!-- ref type="invalid" n="5" target="">bad target, no pointer (2B caught by RNG)</ref -->
              <!-- (Currently a RELAX NG error in this file is not
                   testable; a RELAX NG error in detest.xml is, of
                   course, testable. Thus I have created a copy of
                   this <listRef> in the detest.xml file that includes
                   <ref>#5 so it gets tested. -->
              <listRef type="invalid">
                <ptr type="valid" target="#ptr_OK_but_nested_listRef_NOT_valid"/>
              </listRef>
            </listRef>
          </elementSpec>

          <elementSpec ident="no_duplicate_attrs_1_valid" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="att.global"/>
            </classes>
            <content><empty/></content>
            <attList>
              <attDef ident="bad" ns="https://www.teitube.com/watch?v=enuOArEfqGo"/>
              <attDef ident="good" ns="https://www.teitube.com/watch?v=6YdkQWN59HY"/>
              <attDef ident="better" ns="https://www.teitube.com/watch?v=qSzYchDIk7E"/>
              <attDef ident="best" ns="https://www.teitube.com/watch?v=klsEniiVg74"/>
              <attDef ident="bad" ns="https://www.teitube.com/watch?v=Qikp08PPBf0"/>
            </attList>
            <remarks ident="no_duplicate_attrs_1_valid-remarks" xml:lang="en" versionDate="2024-03-15">
              <p>Here we are testing the Schematron that tests for duplicate
              attribute definitions, i.e. <name>no_duplicate_attrs</name>.</p>
              <p>This <gi>attList</gi> should be valid because
              although there are two <att>bad</att> attributes defined
              as siblings, they have different namespaces.</p>
              <p>Note that because this element is not a member of any
              model class nor in any other element’s content model, it
              will probably not show up in an output schema, which is
              a good thing, because defining an attribute twice like
              that is an error in at least RELAX NG and DTD.</p>
            </remarks>
          </elementSpec>

          <elementSpec ident="no_duplicate_attrs_1_invalid" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="att.global"/>
            </classes>
            <content><empty/></content>
            <attList>
              <attDef ident="bad"/>
              <attDef ident="good"/>
              <attDef ident="better"/>
              <attDef ident="best"/>
              <attDef ident="bad"/>
            </attList>
            <remarks ident="no_duplicate_attrs_1_invalid-remarks" xml:lang="en" versionDate="2024-03-13">
              <p>Here we are testing the Schematron that tests for duplicate
              attribute definitions, i.e. <name>no_duplicate_attrs</name>.</p>
              <p>This <gi>attList</gi> should be invalid because there
              are two <att>bad</att> attributes defined as siblings.</p>
              <p>Note that because this element is not a member of any
              model class nor in any other element’s content model, it
              will probably not show up in an output schema, which is
              a good thing, because defining an attribute twice like
              that is an error in at least RELAX NG and DTD.</p>
            </remarks>
          </elementSpec>

          <elementSpec ident="no_duplicate_attrs_2_valid" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="att.global"/>
            </classes>
            <content><empty/></content>
            <attList>
              <attDef ident="have"/>
              <attList org="choice">
                <attDef ident="fun"/>
                <attDef ident="fun"/>
                <attDef ident="fun"/>
              </attList>
              <attDef ident="til"/>
              <attDef ident="her"/>
              <attDef ident="daddy"/>
            </attList>
            <remarks ident="no_duplicate_attrs_2_valid-remarks" xml:lang="en" versionDate="2024-03-13">
              <p>Here we are testing the Schematron that tests for duplicate
              attribute definitions, i.e. <name>no_duplicate_attrs</name>.</p>
              <p>This <gi>attList</gi> should be valid because,
              although there are three <att>fun</att> attributes
              defined as siblings, they are in alternation with one
              another.</p>
              <p>Note that because this element is not a member of any
              model class nor in any other element’s content model, it
              will probably not show up in an output schema.</p>
            </remarks>
          </elementSpec>

          <elementSpec ident="no_duplicate_attrs_3_invalid" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="att.global"/>
            </classes>
            <content><empty/></content>
            <attList>
              <attList org="choice">
                <attDef ident="Your"/>
                <attDef ident="My"/>
              </attList>
              <attDef ident="spirit"/> 
              <attDef ident="and"/> 
              <attList org="choice">
                <attDef ident="my"/>
                <attDef ident="your"/>
              </attList>
              <attDef ident="voice"/> 
              <attDef ident="in"/> 
              <attDef ident="one"/> 
              <attDef ident="combined"/>
              <attDef ident="The"/> 
              <attDef ident="Phantom"/> 
              <attDef ident="of"/> 
              <attDef ident="the"/> 
              <attDef ident="Opera"/> 
              <attDef ident="is"/> 
              <attDef ident="there"/>
              <attDef ident="Inside"/>
              <attList org="choice">
                <attDef ident="my"/>
                <attDef ident="your"/>
              </attList>
              <attDef ident="mind"/>
            </attList>
            <remarks ident="no_duplicate_attrs_3_invalid" xml:lang="en" versionDate="2024-03-13">
              <p>Here we are testing the Schematron that tests for duplicate
              attribute definitions, i.e. <name>no_duplicate_attrs</name>.</p>
              <p>This <gi>attList</gi> should be invalid because there
              are both two <att>my</att> and two <att>your</att>
              attributes defined, and although each is in an alternate
              group, the two <att>my</att> attributes are not in
              alternation with one another (nor are the two
              <att>your</att>s).</p>
              <p>Note that the <att>Your</att> vs <att>your</att> and
              <att>The</att> vs <att>the</att> are not problems at all
              — XML is completely case sensitive, those are different
              attributes.</p>
              <p>Note that because this element is not a member of any
              model class nor in any other element’s content model, it
              will probably not show up in an output schema, which is
              a good thing, because defining an attribute twice like
              that is an error in at least RELAX NG and DTD.</p>
            </remarks>
          </elementSpec>

          <elementSpec ident="no_duplicate_attrs_3_valid" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="att.global"/>
            </classes>
            <content><empty/></content>
            <attList>
              <attList org="choice">
                <attDef ident="Your"/>
                <attDef ident="My"/>
              </attList>
              <attDef ident="spirit"/> 
              <attDef ident="and"/> 
              <attList org="choice">
                <attDef ident="my" ns="https://www.teitube.com/watch?v=TM23gaT4zkY"/>
                <attDef ident="your" ns="https://www.teitube.com/watch?v=j9qLfyLowjg"/>
              </attList>
              <attDef ident="voice"/> 
              <attDef ident="in"/> 
              <attDef ident="one"/> 
              <attDef ident="combined"/>
              <attDef ident="The"/> 
              <attDef ident="Phantom"/> 
              <attDef ident="of"/> 
              <attDef ident="the"/> 
              <attDef ident="Opera"/> 
              <attDef ident="is"/> 
              <attDef ident="there"/>
              <attDef ident="Inside"/>
              <attList org="choice">
                <attDef ident="my" ns="https://www.teitube.com/watch?v=FKHMRGMkQHU"/>
                <attDef ident="your" ns="https://www.teitube.com/watch?v=TQGQgiKDBbU"/>
              </attList>
              <attDef ident="mind"/>
            </attList>
            <remarks ident="no_duplicate_attrs_3_valid-remarks" xml:lang="en" versionDate="2024-03-15">
              <p>Here we are testing the Schematron that tests for duplicate
              attribute definitions, i.e. <name>no_duplicate_attrs</name>.</p>
              <p>This <gi>attList</gi> should be valid because although there
              are both two <att>my</att> and two <att>your</att>
              attributes defined that are not in alternation, they are
              in different namespaces.</p>
              <p>Note that the <att>Your</att> vs <att>your</att> and
              <att>The</att> vs <att>the</att> are not problems at all
              — XML is completely case sensitive, those are different
              attributes.</p>
              <p>Note that because this element is not a member of any
              model class nor in any other element’s content model, it
              will probably not show up in an output schema, which is
              a good thing, because defining an attribute twice like
              that is an error in at least RELAX NG and DTD.</p>
            </remarks>
          </elementSpec>

          <elementSpec ident="no_duplicate_attrs_4_invalid" mode="add">
            <desc xml:lang="en" versionDate="2024-03-13">
              Another completely spurious element made up for testing purposes only.
              For information on what is being tested, see <gi>remarks</gi>.
            </desc>
            <classes>
              <memberOf key="att.global"/>
            </classes>
            <content><empty/></content>
            <attList>
              <attDef ident="all"/>
              <attDef ident="the"/>
              <attDef ident="leaves"/>
              <attDef ident="are"/>
              <attDef ident="brown"/>
              <attList>
                <attDef ident="and"/>
                <attList>
                  <attDef ident="the"/>
                  <attDef ident="sky"/>
                </attList>
                <attDef ident="is"/>
              </attList>
              <attDef ident="gray"/>
            </attList>
            <remarks ident="no_duplicate_attrs_4_invalid-remarks" xml:lang="en" versionDate="2024-03-13">
              <p>Here we are testing the Schematron that tests for duplicate
              attribute definitions, i.e. <name>no_duplicate_attrs</name>.</p>
              <p>This <gi>attList</gi> should be invalid due to the
              two definitions of the <att>the</att> attribute, which
              are not in alternation.</p>
              <p>Note that because this element is not a member of any
              model class nor in any other element’s content model, it
              will probably not show up in an output schema, which is
              a good thing, because defining an attribute twice like
              that is an error in at least RELAX NG and DTD.</p>
            </remarks>
          </elementSpec>
         
          <specGrpRef target="#limit_attrs_on_elementRef"/>
          <elementSpec ident="test_elementRef_attr_constraints" mode="add">
            <desc xml:lang="en" versionDate="2024-05-02">yet another completely spurious element made up for testing purposes only</desc>
            <classes>
              <memberOf key="att.global"/>
              <memberOf key="model.pPart.data"/>
            </classes>
            <content>
              <alternate>
                <elementRef key="idno" source="tei:3.5.0">
                  <!-- Should be flagged as an error: @source not allowed here -->
                </elementRef>
                <elementRef key="num" minOccurs="2" maxOccurs="5"/>
              </alternate>
            </content>
          </elementSpec>

        </schemaSpec>
      </div>
    </body>
  </text>
</TEI>
