<?xml version="1.0" encoding="utf-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>A test file for TEI which produces errors</title>
      </titleStmt>
      <publicationStmt>
        <p>Unpublished</p>
      </publicationStmt>
      <sourceDesc>
	<p>Born digital</p>
      </sourceDesc>
    </fileDesc>
    <encodingDesc>
<!--  MDH 2013-04-12:
      The following tests a Schematron constraint to the effect that 
      @schemeVersion cannot be used unless @scheme is present and 
      has a value which corresponds to a style language.
      -->
      <styleDefDecl schemeVersion="2.1"></styleDefDecl>
      
<!-- MDH 2013-02-01:
        The following tests a Schematron constraint to the effect that if 
        @method="parallel-segmentation" then @location must be "internal".    -->
      <variantEncoding method="parallel-segmentation" location="external"/>
      <editorialDecl>
	<quotation/>
      </editorialDecl>
    </encodingDesc>
  </teiHeader>
  <text>
    <body>
      <p>This document is for testing validation.</p>
      <p>
        <delSpan/>
      </p>
      <p>This tests the constraint that every &lt;lg&gt; element should have at least one of &lt;lg&gt;, &lt;lg&gt; or &lt;gap&gt; inside it.</p>
      <p>Added by MDH.</p>

      <div>
        <lg/>
      </div>

      <div>
	<p>Added by MDH. This tests the Schematron constraint that any element with @calendar must have some textual content.</p>
	<p><date when="2012-09-06" calendar="http://en.wikipedia.org/wiki/Gregorian_calendar"/></p>
      </div>

      <div>
        <head>Testing schematron constraints</head>
        <p xml:lang="la">sicut erat in <bibl><author>freddy</author></bibl> principia <list><item><num value="0.234"/><num value="0.0234E23"/><num value="1/2"/>
cats</item></list>
      </p>

<div type="testingSpan">
<p><del>This has some content which is OK </del>
<delSpan spanTo="#ds1"/>This one doesn't<anchor xml:id="ds1"/> but
that's also OK.
<delSpan/> That last one is illegal
<delSpan spanTo="#ds2"/> as are that one
<delSpan spanTo="notMeaningful"/> and that one</p>
</div>

        <div type="canon">
          <head>Canon 1</head>
          <p>hello</p>
          <div type="canonText">
            <head>A Canon Text</head>
            <p>hello</p>
          </div>
        </div>
        <div type="canon">
          <head>Canon 2</head>
          <p>hello</p>
          <div type="canonText">
            <head>A Canon Text</head>
            <p>hello</p>
          </div>
          <div type="canonText">
            <head>A 2nd Canon Text</head>
            <p>hello</p>
          </div>
        </div>
        <div type="canon">
          <head>Canon 3</head>
          <div type="canon">
            <head>Canon 4</head>
          </div>
        </div>
        <div type="register">
          <head>Register 1</head>
          <div type="canon">
            <head>Canon 5</head>
          </div>
        </div>
        <div type="redundant">
          <p>
            <s>This sentence contains
	    <s>an illegally nested phrase</s>
	    and should trigger a schematron squawk</s>
          </p>
        </div>
      </div>
      <div type="test">
        <p>Testing multiple occurences of a datatype in a single attribute
    value. The following should be valid:
     <distinct type="valid" o01="0" o02="0" o0i="0" o11="0" o12="1" o1i="1" o22="1 2" o2i="1 2">minimum</distinct>
     <distinct type="valid" o01="1" o02="1" o0i="1" o11="1" o12="1 2" o1i="1 2" o22="1 2" o2i="1 2 3">min +1 unless ≤, in which case max</distinct> 
     <distinct type="valid" o01="1" o02="1 2" o0i="1 2 3 4 5 6 7 8 9 0" o11="1" o12="1 2" o1i="1 2 3 4 5 6 7 8 9 0" o22="1 2" o2i="1 2 3 4 5 6 7 8 9 0">max</distinct>
  </p>
      </div>

      <div>
        <head>The blort element, just to play with</head>
        <!-- following shd be errors and are correctly detected by emacs -->
        <p>
          <blort truth="no" numeric="fig" prob="low" sex="yes" temporal="1994-31-12" count="-1"/>
          <!-- following shd be errors but are not detected by emacs -->
          <blort xml:lang="wibble" prob="12345"/>
          <!-- following shd not be errors -->
          <blort truth="false" xtruth="inapplicable" sex="2" temporal="1994-12-31" count="42"/>
          <blort cert="high" dur="P3M" enumerated=" dog  breath" temporal="--12-25"/>
          <blort key="123// wibble = 1^+ !!! $ ‰ false" language="sa" temporal="1994-12-31T12:00:00"/>
          <blort pointers="#foo #wibble" names="mutt jeff" pattern="[a-z]\w*w\/s" numeric="42"/>
          <blort numeric="-1.3" name="_12-45.dot"/>
          <blort temporal="1994-12-31"/>
          <blort pointer="http://www.tei-c.org" name="123"/>
          <blort prob="0.456"/>
          <blort/>
        </p>
      </div>
      <div>
        <head>
          <lg>
            <l>Bent double, like old beggars under sacks, </l>
          </lg>
        </head>
      </div>
      <div>
        <head>
          <l>Bent double, like old beggars under sacks, </l>
          <l>Knock-kneed, coughing like hags, we cursed through sludge, </l>
        </head>
        <lg>
          <l>Bent double, like old beggars under sacks, </l>
          <l>Knock-kneed, coughing like hags, we cursed through sludge, </l>
          <l>Till on the haunting flares we turned our backs </l>
          <l>And towards our distant rest began to trudge. </l>
          <l>Bent double, like old beggars under sacks, </l>
          <l>Knock-kneed, coughing like hags, we cursed through sludge, </l>
          <l>Till on the haunting flares we turned our backs </l>
          <l>And towards our distant rest began to trudge. </l>
        </lg>
      </div>

      <div>
        <head>Some transcribed text with subst errors</head>
        <p>... are all included. <del hand="#RG">It is</del>
    <subst><add>T</add></subst>the expressed</p>
        <p> that he and his Sister Miſs D — <lb/>who always lived with him, wd. be very <subst><lb/><add>principally</add></subst> remembered in her Will.</p>
        <p><subst>ἐπιτρέψῃ [ἐπετρέψῃ]</subst> τῷ ὑποδέκτῃ μὴ ὀχλῆσαι</p>
        <p>τ<subst><add place="above">ῶν</add></subst>α συνκυρόντων<subst><del>α</del></subst> ἐργαστηρί<hi rend="above">ων</hi><subst><del>α</del></subst></p>
        <p>While <del xml:id="r112">pondering</del> thus <add xml:id="r113">she mus'd</add>, her pinions fann'd<substJoin target="#r112 #r113"/></p>
      </div>

      <div>
	<head>Rules about span</head>
	<p xml:id="spanTest"/>
	<p xml:id="spanTest2"/>
	<p> ... <span from="#spanTest">freddy</span></p>
	<p> ... <span target="#spanTest">freddy</span></p>
	<p> ... <span from="#spanTest2" target="#spanTest">freddy</span></p>
	<p> ... <span to="#spanTest2" target="#spanTest">freddy</span></p>
      </div>

     <div>
	<head>Checking locally-changed attributes</head>
	<p><abbr subtype="test">freddy</abbr></p>
	<p><alt target="#spanTest" mode="excl"/></p>
	<p><alt target="#spanTest #spanTest2" mode="excl"/></p>
      </div>

      <div>
	<head>Media</head>
	<p><media mimeType="video/mp4"/></p>
	<p><media url="foo.png"/></p>
      </div>

      <div xml:id="subtypeTyped">
	<head>@subtype requires @type</head>
	<p>Added 2013-01-11 17:31 by Syd</p>
	<div type="major" subtype="minor">test both</div>
	<div type="major">test @type only</div>
	<div subtype="minor">test @subtype only (should FAIL)</div>
	<div>test neither</div>
      </div>

      <div>
	<head>Shift should have a new attribute</head>
	<u who="who"><shift new="something"/>some thing<shift/>some more</u>
      </div>

      <div>
	<head>msPart/altIdentifier deprecated</head>
	<p><label>Syd 2014-09-09:</label> Should get a deprecation
	warning for <gi>altIdentifier</gi> as a child of
	<gi>msPart</gi>. Someday (around 2016-09-09) this should
	become outright invalid, and the Schematron rule should be
	removed.</p>
	<msDesc>
	  <msIdentifier>
	    <msName>Test msPart/altIdentifier rule</msName>
	  </msIdentifier>
	  <msPart>
	    <altIdentifier>
	      <idno>0BAD</idno>
	    </altIdentifier>
	  </msPart>
	  <msPart>
	    <msIdentifier>
	      <msName>this one should be valid</msName>
	    </msIdentifier>
	  </msPart>
	</msDesc>
      </div>

      <div>
	<head>biblStruct/idno deprecated</head>
	<p><label>Syd 2014-09-19:</label> Should get a deprecation
	warning for <gi>idno</gi> as a child of <gi>biblStruct</gi>.
	Someday (around 2016-09-09) this should become outright
	invalid, and the Schematron rule should be removed.</p>
	<biblStruct xml:id="previous_COHQHF-eg-5">
	  <monogr>
	    <author>Marriott, Henry J. L.</author>
	    <title>Practical Electrocardiography</title>
	    <edition>eighth edition</edition>
	    <imprint>
	      <pubPlace>Baltimore</pubPlace>
	      <publisher>Williams &amp; Wilkins</publisher>
	      <date when="1988"/>
	    </imprint>
	  </monogr>
	  <idno type="isbn">0-683-05576-3</idno>
	  <citedRange unit="pp">147</citedRange>
	</biblStruct>
      </div>

      <div>
	<head>gloss list should have label-item pairs</head>
	<p>Only the 3rd list (with the word <q>error</q>) should raise
	an error from <ident>gloss-list-must-have-labels</ident>.</p>
	<list>
	  <item>untyped list with only <gi>item</gi>s</item>
	</list>
	<list>
	  <label>ULLIP</label> <item>untyped list with
	  <gi>label</gi>-<gi>item</gi> pairs</item>
	</list>
	<list type="gloss">
	  <item>gloss list with only <gi>item</gi>s; an error</item>
	</list>
	<list type="gloss">
	  <label>GLLIP</label> <item>gloss list with
	  <gi>label</gi>-<gi>item</gi> pairs</item>
	</list>
      </div>

    </body>
  </text>
</TEI>
