<?xml version="1.0" encoding="utf-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"><!--Schema generated 2013-01-17T19:45:23Z
Edition: 2.3.0. Last updated on 17th January 2013.
This material is dual-licensed.

	  [http://creativecommons.org/licenses/by/3.0/] 
	    Distributed under a Creative Commons Attribution 3.0 Unported License.
	  
	  [http://www.opensource.org/licenses/BSD-2-Clause] 
	    Copyright 2013 TEI Consortium.
	    All rights reserved.
	    
	    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
	    
	      Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
	      Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.



This software is provided by the copyright holders and contributors
"as is" and any express or implied warranties, including, but not
limited to, the implied warranties of merchantability and fitness for
a particular purpose are disclaimed. In no event shall the copyright
holder or contributors be liable for any direct, indirect, incidental,
special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use,
data, or profits; or business interruption) however caused and on any
theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use
of this software, even if advised of the possibility of such
damage.

	  TEI  material can be licensed differently depending on the use you intend to 
make of it. Hence it is made available under both the CC+BY and BSD-2 
licences.  The CC+BY licence is generally appropriate for usages which 
treat TEI content as data or documentation. The BSD-2 licence is 
generally appropriate for usage of TEI content in a software 
environment. For further information or clarification, please contact 
the TEI Consortium.
	  
	 Critical Apparatus--><!--Definitions from module textcrit--><!--Set global predeclared macros--><!--Set predeclared macros--><!--0. predeclared macros--><!--1. classes--><define name="model.rdgLike">
      <choice>
         <ref name="rdg"/>
      </choice>
   </define>
   <define name="model.rdgLike_alternation">
      <choice>
         <ref name="rdg"/>
      </choice>
   </define>
   <define name="model.rdgLike_sequence">
      <ref name="rdg"/>
   </define>
   <define name="model.rdgLike_sequenceOptional">
      <optional>
         <ref name="rdg"/>
      </optional>
   </define>
   <define name="model.rdgLike_sequenceOptionalRepeatable">
      <zeroOrMore>
         <ref name="rdg"/>
      </zeroOrMore>
   </define>
   <define name="model.rdgLike_sequenceRepeatable">
      <oneOrMore>
         <ref name="rdg"/>
      </oneOrMore>
   </define>
   <define name="model.rdgPart">
      <choice>
         <ref name="wit"/>
         <ref name="witStart"/>
         <ref name="witEnd"/>
         <ref name="lacunaStart"/>
         <ref name="lacunaEnd"/>
      </choice>
   </define>
   <define name="model.rdgPart_alternation">
      <choice>
         <ref name="wit"/>
         <ref name="witStart"/>
         <ref name="witEnd"/>
         <ref name="lacunaStart"/>
         <ref name="lacunaEnd"/>
      </choice>
   </define>
   <define name="model.rdgPart_sequence">
      <ref name="wit"/>
      <ref name="witStart"/>
      <ref name="witEnd"/>
      <ref name="lacunaStart"/>
      <ref name="lacunaEnd"/>
   </define>
   <define name="model.rdgPart_sequenceOptional">
      <optional>
         <ref name="wit"/>
      </optional>
      <optional>
         <ref name="witStart"/>
      </optional>
      <optional>
         <ref name="witEnd"/>
      </optional>
      <optional>
         <ref name="lacunaStart"/>
      </optional>
      <optional>
         <ref name="lacunaEnd"/>
      </optional>
   </define>
   <define name="model.rdgPart_sequenceOptionalRepeatable">
      <zeroOrMore>
         <ref name="wit"/>
      </zeroOrMore>
      <zeroOrMore>
         <ref name="witStart"/>
      </zeroOrMore>
      <zeroOrMore>
         <ref name="witEnd"/>
      </zeroOrMore>
      <zeroOrMore>
         <ref name="lacunaStart"/>
      </zeroOrMore>
      <zeroOrMore>
         <ref name="lacunaEnd"/>
      </zeroOrMore>
   </define>
   <define name="model.rdgPart_sequenceRepeatable">
      <oneOrMore>
         <ref name="wit"/>
      </oneOrMore>
      <oneOrMore>
         <ref name="witStart"/>
      </oneOrMore>
      <oneOrMore>
         <ref name="witEnd"/>
      </oneOrMore>
      <oneOrMore>
         <ref name="lacunaStart"/>
      </oneOrMore>
      <oneOrMore>
         <ref name="lacunaEnd"/>
      </oneOrMore>
   </define>
   <define name="att.rdgPart.attributes">
      <ref name="att.rdgPart.attribute.wit"/>
   </define>
   <define name="att.rdgPart.attribute.wit">
      <optional>
         <attribute name="wit">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(witness or witnesses) contains a list of one or more sigla indicating the witnesses
which begin or end at this point.</a:documentation>
            <list>
               <oneOrMore>
                  <ref name="data.pointer"/>
               </oneOrMore>
            </list>
         </attribute>
      </optional>
   </define>
   <define name="att.witnessed.attributes">
      <ref name="att.witnessed.attribute.wit"/>
   </define>
   <define name="att.witnessed.attribute.wit">
      <optional>
         <attribute name="wit">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(witness or witnesses) contains a list of one or more pointers indicating the witnesses
which attest to a given reading.</a:documentation>
            <list>
               <oneOrMore>
                  <ref name="data.pointer"/>
               </oneOrMore>
            </list>
         </attribute>
      </optional>
   </define>
   <define name="att.textCritical.attributes">
      <ref name="att.responsibility.attributes"/>
      <ref name="att.textCritical.attribute.type"/>
      <ref name="att.textCritical.attribute.cause"/>
      <ref name="att.textCritical.attribute.varSeq"/>
      <ref name="att.textCritical.attribute.hand"/>
   </define>
   <define name="att.textCritical.attribute.type">
      <optional>
         <attribute name="type">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">classifies the reading according to some useful typology.
Sample values include: 1] substantive; 2] orthographic</a:documentation>
            <ref name="data.enumerated"/>
         </attribute>
      </optional>
   </define>
   <define name="att.textCritical.attribute.cause">
      <optional>
         <attribute name="cause">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">classifies the cause for the variant reading, according to
any appropriate typology of possible origins.
Sample values include: 1] homeoteleuton; 2] homeoarchy; 3] paleographicConfusion; 4] haplography; 5] dittography; 6] falseEmendation</a:documentation>
            <ref name="data.enumerated"/>
         </attribute>
      </optional>
   </define>
   <define name="att.textCritical.attribute.varSeq">
      <optional>
         <attribute name="varSeq">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(variant sequence) provides a number indicating the position of this reading in a
sequence, when there is reason to presume a sequence to the variants
on any one lemma.</a:documentation>
            <ref name="data.count"/>
         </attribute>
      </optional>
   </define>
   <define name="att.textCritical.attribute.hand">
      <optional>
         <attribute name="hand">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">signifies the hand responsible for a particular reading in the
witness.</a:documentation>
            <ref name="data.pointer"/>
         </attribute>
      </optional>
   </define>
   <!--2. elements--><define name="app">
      <element name="app">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(apparatus entry) contains one entry in a critical apparatus, with an optional
lemma and usually one or more reading or a note on the relevant passage. []</a:documentation>
         <ref name="app.content"/>
         <ref name="app.localattributes"/>
      </element>
   </define>
   <define name="app.content">
      <group>
         <zeroOrMore>
            <ref name="model.global"/>
         </zeroOrMore>
         <optional>
            <ref name="lem"/>
            <zeroOrMore>
               <ref name="model.global"/>
            </zeroOrMore>
            <optional>
               <ref name="wit"/>
               <zeroOrMore>
                  <ref name="model.global"/>
               </zeroOrMore>
            </optional>
         </optional>
         <zeroOrMore>
            <choice>
               <group>
                  <ref name="model.rdgLike"/>
                  <zeroOrMore>
                     <ref name="model.global"/>
                  </zeroOrMore>
                  <optional>
                     <ref name="wit"/>
                     <zeroOrMore>
                        <ref name="model.global"/>
                     </zeroOrMore>
                  </optional>
               </group>
               <group>
                  <ref name="rdgGrp"/>
                  <zeroOrMore>
                     <ref name="model.global"/>
                  </zeroOrMore>
                  <optional>
                     <ref name="wit"/>
                     <zeroOrMore>
                        <ref name="model.global"/>
                     </zeroOrMore>
                  </optional>
               </group>
            </choice>
         </zeroOrMore>
      </group>
    
      <pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="app-constraint-only1lem">
         <rule context="tei:app">
            <sch:assert xmlns:sch="http://purl.oclc.org/dsdl/schematron"
                        xmlns="http://www.tei-c.org/ns/1.0"
                        xmlns:rng="http://relaxng.org/ns/structure/1.0"
                        test="count( descendant::tei:lem[ generate-id(    current() ) = generate-id(    ancestor::tei:app[1] ) ]) &lt;       2">
Only one &lt;lem&gt; element may appear within a single  apparatus
entry, whether it appears outside a &lt;rdgGrp&gt;
element or within it.</sch:assert>
         </rule>
      </pattern>
    
  </define>
   <define name="app.localattributes">
      <ref name="att.global.attributes"/>
      <optional>
         <attribute name="type">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">classifies the variation contained in this element according to
some convenient typology.</a:documentation>
            <ref name="data.enumerated"/>
         </attribute>
      </optional>
      <optional>
         <attribute name="from">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">identifies the beginning of the lemma in the base text, if
necessary.</a:documentation>
            <ref name="data.pointer"/>
         </attribute>
      </optional>
      <optional>
         <attribute name="to">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">identifies the endpoint of the lemma in the base text, if
necessary.</a:documentation>
            <ref name="data.pointer"/>
         </attribute>
      </optional>
      <optional>
         <attribute name="loc">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(location) indicates the location of the variation, when the
location-referenced method of apparatus markup is used.</a:documentation>
            <list>
               <oneOrMore>
                  <ref name="data.word"/>
               </oneOrMore>
            </list>
         </attribute>
      </optional>
      <empty/>
   </define>
   <define name="lacunaEnd">
      <element name="lacunaEnd">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates the end of a lacuna in a mostly complete textual
witness. []</a:documentation>
         <ref name="lacunaEnd.content"/>
         <ref name="lacunaEnd.localattributes"/>
      </element>
   </define>
   <define name="lacunaEnd.content">
      <empty/>
   </define>
   <define name="lacunaEnd.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.rdgPart.attributes"/>
      <empty/>
   </define>
   <define name="lacunaStart">
      <element name="lacunaStart">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates the beginning of a lacuna in the text of a mostly
complete textual witness. []</a:documentation>
         <ref name="lacunaStart.content"/>
         <ref name="lacunaStart.localattributes"/>
      </element>
   </define>
   <define name="lacunaStart.content">
      <empty/>
   </define>
   <define name="lacunaStart.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.rdgPart.attributes"/>
      <empty/>
   </define>
   <define name="lem">
      <element name="lem">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(lemma) contains the lemma, or base text, of a textual variation. []</a:documentation>
         <ref name="lem.content"/>
         <ref name="lem.localattributes"/>
      </element>
   </define>
   <define name="lem.content">
      <zeroOrMore>
         <choice>
            <text/>
            <ref name="model.gLike"/>
            <ref name="model.phrase"/>
            <ref name="model.inter"/>
            <ref name="model.global"/>
            <ref name="model.rdgPart"/>
         </choice>
      </zeroOrMore>
   </define>
   <define name="lem.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.textCritical.attributes"/>
      <ref name="att.witnessed.attributes"/>
      <empty/>
   </define>
   <define name="listApp">
      <element name="listApp">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(list of apparatus entries) contains a list of apparatus entries.  []</a:documentation>
         <ref name="listApp.content"/>
         <ref name="listApp.localattributes"/>
      </element>
   </define>
   <define name="listApp.content">
      <group>
         <zeroOrMore>
            <ref name="model.headLike"/>
         </zeroOrMore>
         <oneOrMore>
            <choice>
               <ref name="app"/>
               <ref name="listApp"/>
            </choice>
         </oneOrMore>
      </group>
   </define>
   <define name="listApp.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.sortable.attributes"/>
      <ref name="att.declarable.attributes"/>
      <ref name="att.typed.attributes"/>
      <empty/>
   </define>
   <define name="listWit">
      <element name="listWit">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(witness list) lists definitions for all the witnesses referred to by a critical
  apparatus, optionally grouped hierarchically. []</a:documentation>
         <ref name="listWit.content"/>
         <ref name="listWit.localattributes"/>
      </element>
   </define>
   <define name="listWit.content">
      <group>
         <optional>
            <ref name="model.headLike"/>
         </optional>
         <oneOrMore>
            <choice>
               <ref name="witness"/>
               <ref name="listWit"/>
            </choice>
         </oneOrMore>
      </group>
   </define>
   <define name="listWit.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.sortable.attributes"/>
      <empty/>
   </define>
   <define name="rdg">
      <element name="rdg">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(reading) contains a single reading within a textual variation. []</a:documentation>
         <ref name="rdg.content"/>
         <ref name="rdg.localattributes"/>
      </element>
   </define>
   <define name="rdg.content">
      <zeroOrMore>
         <choice>
            <text/>
            <ref name="model.gLike"/>
            <ref name="model.phrase"/>
            <ref name="model.inter"/>
            <ref name="model.global"/>
            <ref name="model.rdgPart"/>
         </choice>
      </zeroOrMore>
   </define>
   <define name="rdg.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.textCritical.attributes"/>
      <ref name="att.witnessed.attributes"/>
      <empty/>
   </define>
   <define name="rdgGrp">
      <element name="rdgGrp">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(reading group) within a textual variation,
groups two or more readings perceived to have a genetic
relationship or other affinity. []</a:documentation>
         <ref name="rdgGrp.content"/>
         <ref name="rdgGrp.localattributes"/>
      </element>
   </define>
   <define name="rdgGrp.content">
      <group>
         <oneOrMore>
            <choice>
               <group>
                  <ref name="rdgGrp"/>
                  <optional>
                     <ref name="wit"/>
                  </optional>
               </group>
               <zeroOrMore>
                  <group>
                     <optional>
                        <group>
                           <ref name="lem"/>
                           <optional>
                              <ref name="wit"/>
                           </optional>
                        </group>
                     </optional>
                     <group>
                        <ref name="model.rdgLike"/>
                        <optional>
                           <ref name="wit"/>
                        </optional>
                     </group>
                  </group>
               </zeroOrMore>
            </choice>
         </oneOrMore>
      </group>
   </define>
   <define name="rdgGrp.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.textCritical.attributes"/>
      <empty/>
   </define>
   <define name="variantEncoding">
      <element name="variantEncoding">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">declares the method used to encode text-critical variants. []</a:documentation>
         <ref name="variantEncoding.content"/>
         <ref name="variantEncoding.localattributes"/>
      </element>
   </define>
   <define name="variantEncoding.content">
      <empty/>
   </define>
   <define name="variantEncoding.localattributes">
      <ref name="att.global.attributes"/>
      <attribute name="method">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates which method is used to encode the apparatus of
variants.</a:documentation>
         <choice>
            <value>location-referenced</value>
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">apparatus uses line numbers or other canonical reference scheme
referenced in a base text.</a:documentation>
            <value>double-end-point</value>
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">apparatus indicates the precise locations of the beginning and
ending of each lemma relative to a base text.</a:documentation>
            <value>parallel-segmentation</value>
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">alternate readings of a passage are given in parallel in the
text; no notion of a base text is necessary.</a:documentation>
         </choice>
      </attribute>
      <attribute name="location">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates whether the apparatus appears within the running text
or external to it.</a:documentation>
         <choice>
            <value>internal</value>
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">apparatus appears within the running text.</a:documentation>
            <value>external</value>
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">apparatus appears outside the base text.</a:documentation>
         </choice>
      </attribute>
      <empty/>
   </define>
   <define name="wit">
      <element name="wit">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">contains a list of one or more sigla of witnesses attesting a
given reading, in a textual variation. []</a:documentation>
         <ref name="wit.content"/>
         <ref name="wit.localattributes"/>
      </element>
   </define>
   <define name="wit.content">
      <ref name="macro.phraseSeq"/>
   </define>
   <define name="wit.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.rdgPart.attributes"/>
      <empty/>
   </define>
   <define name="witDetail">
      <element name="witDetail">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(witness detail) gives further information about a particular witness, or
witnesses, to a particular reading. []</a:documentation>
         <ref name="witDetail.content"/>
         <ref name="witDetail.localattributes"/>
      </element>
   </define>
   <define name="witDetail.content">
      <ref name="macro.phraseSeq"/>
   </define>
   <define name="witDetail.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.placement.attributes"/>
      <ref name="att.responsibility.attributes"/>
      <ref name="att.pointing.attributes"/>
      <attribute name="wit">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(witnesses) indicates the sigil or sigla for the witnesses to which the
detail refers.</a:documentation>
         <list>
            <oneOrMore>
               <ref name="data.pointer"/>
            </oneOrMore>
         </list>
      </attribute>
      <optional>
         <attribute name="type">
            <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">describes the type of information given about the witness.</a:documentation>
            <ref name="data.enumerated"/>
         </attribute>
      </optional>
      <empty/>
   </define>
   <define name="witEnd">
      <element name="witEnd">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(fragmented witness end) indicates the end, or suspension, of the text of a fragmentary
witness. []</a:documentation>
         <ref name="witEnd.content"/>
         <ref name="witEnd.localattributes"/>
      </element>
   </define>
   <define name="witEnd.content">
      <empty/>
   </define>
   <define name="witEnd.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.rdgPart.attributes"/>
      <empty/>
   </define>
   <define name="witStart">
      <element name="witStart">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(fragmented witness start) indicates the beginning, or resumption, of the text of a
fragmentary witness. []</a:documentation>
         <ref name="witStart.content"/>
         <ref name="witStart.localattributes"/>
      </element>
   </define>
   <define name="witStart.content">
      <empty/>
   </define>
   <define name="witStart.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.rdgPart.attributes"/>
      <empty/>
   </define>
   <define name="witness">
      <element name="witness">
         <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">contains either a description of a single witness referred to
within the critical apparatus, or a list of witnesses which is to be
referred to by a single sigil. []</a:documentation>
         <ref name="witness.content"/>
         <ref name="witness.localattributes"/>
      </element>
   </define>
   <define name="witness.content">
      <ref name="macro.limitedContent"/>
   </define>
   <define name="witness.localattributes">
      <ref name="att.global.attributes"/>
      <ref name="att.sortable.attributes"/>
      <empty/>
   </define>
   <!--3. macros--></grammar>