namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace rng = "http://relaxng.org/ns/structure/1.0"

# Schema generated 2006-01-30T20:23:55Z
# Copyright 2005 TEI Consortium.
# This is free software; you can redistribute it and/or
#	    modify it under the terms of the GNU General Public
#	    License as published by the Free Software Foundation;
#	    either version 2 of the License, or (at your option) any
#	    later version.
# This material is distributed in the hope that it will be
#	    useful, but WITHOUT ANY WARRANTY; without even the implied
#	    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#	    PURPOSE. See the GNU General Public License for more
#	    details.
# You should have received a copy of the GNU General Public
#	    License along with this file; if not, write to the Free
#	    Software Foundation, Inc., 59 Temple Place, Suite 330,
#	    Boston, MA 02111-1307, USA.
# To contact the TEI Consortium use the following addresses.
#	    For general (non-technical) enquiries: 
#		  target="mailto:info@tei-c.org"/>info@tei-c.orgFor membership enquiries: membership@tei-c.orgFor technical enquiries, particularly about the
#		Guidelines, DTDs, schemas, or software available from
#		the TEI-C: editors@tei-c.orgFor up to date information, consult the TEI web site at http://www.tei-c.org/P5

# Definitions from module textcrit

# Set predeclared macros

# 0. predeclared macros

# 1. classes
model.rdgPart = notAllowed
att.rdgPart.attributes = att.rdgPart.attribute.wit
att.rdgPart.attribute.wit =
  ## contains a list of one or more sigla indicating the witnesses
  ## which begin or end at this point.
  attribute wit { data.pointers }?
att.textCritical.attributes =
  att.textCritical.attribute.wit,
  att.textCritical.attribute.type,
  att.textCritical.attribute.cause,
  att.textCritical.attribute.varSeq,
  att.textCritical.attribute.resp,
  att.textCritical.attribute.hand
att.textCritical.attribute.wit =
  ## contains a list of one or more pointers indicating the witnesses
  ## which attest to a given reading.
  attribute wit { data.pointers }?
att.textCritical.attribute.type =
  ## classifies the reading according to some useful typology.
  attribute type { data.enumerated }?
att.textCritical.attribute.cause =
  ## classifies the cause for the variant reading, according to
  ## any appropriate typology of possible origins.
  attribute cause { data.enumerated }?
att.textCritical.attribute.varSeq =
  ## 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.
  attribute varSeq { xsd:nonNegativeInteger }?
att.textCritical.attribute.resp =
  ## identifies the editor responsible for asserting a
  ##	particular reading in the witness.
  attribute resp { data.pointer }?
att.textCritical.attribute.hand =
  ## signifies the hand responsible for a particular reading in the
  ## witness.
  attribute hand { data.pointer }?
# 2. elements

app =
  ## (apparatus entry) contains one entry in a critical apparatus, with an optional
  ## lemma and at least one reading.
  element app { app.content, app.attributes }
app.content =
  model.global*,
  (lem, model.global*, (wit, model.global*)?)?,
  ((rdg, model.global*, (wit, model.global*)?)
   | (rdgGrp, model.global*, (wit, model.global*)?))+
app.attributes =
  att.global.attributes,
  ## classifies the variation contained in this element according to
  ## some convenient typology.
  attribute type { data.enumerated }?,
  ## identifies the beginning of the lemma in the base text, if
  ## necessary.
  attribute from { data.pointer }?,
  ## identifies the endpoint of the lemma in the base text, if
  ## necessary.
  attribute to { data.pointer }?,
  ## indicates the location of the variation, when the
  ## location-referenced method of apparatus markup is used.
  attribute loc { data.words }?,
  empty
model.pPart.edit |= app

lacunaEnd =
  ## indicates the end of a lacuna in a mostly complete textual
  ## witness.
  element lacunaEnd { lacunaEnd.content, lacunaEnd.attributes }
lacunaEnd.content = empty
lacunaEnd.attributes =
  att.global.attributes, att.rdgPart.attributes, empty
model.rdgPart |= lacunaEnd

lacunaStart =
  ## indicates the beginning of a lacuna in the text of a mostly
  ## complete textual witness.
  element lacunaStart { lacunaStart.content, lacunaStart.attributes }
lacunaStart.content = empty
lacunaStart.attributes =
  att.global.attributes, att.rdgPart.attributes, empty
model.rdgPart |= lacunaStart

lem =
  ## (lemma) contains the lemma, or base text, of a textual variation.
  element lem { lem.content, lem.attributes }
lem.content =
  (text
   | model.gLike
   | model.phrase
   | model.inter
   | model.global
   | model.rdgPart)*
lem.attributes =
  att.global.attributes, att.textCritical.attributes, empty

rdg =
  ## (reading) contains a single reading within a textual variation.
  element rdg { rdg.content, rdg.attributes }
rdg.content =
  (text
   | model.gLike
   | model.phrase
   | model.inter
   | model.global
   | model.rdgPart)*
rdg.attributes =
  att.global.attributes, att.textCritical.attributes, empty

rdgGrp =
  ## (reading group) within a textual variation,
  ## groups two or more readings perceived to have a genetic
  ## relationship or other affinity.
  element rdgGrp { rdgGrp.content, rdgGrp.attributes }
rdgGrp.content =
  ((rdgGrp, wit?)
   | ((lem, wit?)?, (rdg, wit?))*)+
rdgGrp.attributes =
  att.global.attributes, att.textCritical.attributes, empty

wit =
  ## contains a list of one or more sigla of witnesses attesting a
  ## given reading, in a textual variation.
  element wit { wit.content, wit.attributes }
wit.content = macro.paraContent
wit.attributes = att.global.attributes, att.rdgPart.attributes, empty
model.rdgPart |= wit

witDetail =
  ## gives further information about a particular witness, or
  ## witnesses, to a particular reading.
  element witDetail { witDetail.content, witDetail.attributes }
witDetail.content = macro.paraContent
witDetail.attributes =
  att.global.attributes,
  ## indicates the identifier for the reading, or readings, to which
  ## the witness detail refers.
  attribute target { data.pointers },
  ## identifies the individual responsible for  identifying the
  ## witness
  attribute resp { data.pointer }?,
  ## indicates the sigil or sigla for the witnesses to which the
  ## detail refers.
  attribute wit { data.code },
  ## describes the type of information given about the witness.
  attribute type { data.pointers }?,
  ## indicates where the note appears in the source text.
  [ a:defaultValue = "apparatus" ] attribute place { data.enumerated }?,
  empty
model.noteLike |= witDetail

witEnd =
  ## indicates the end, or suspension, of the text of a fragmentary
  ## witness.
  element witEnd { witEnd.content, witEnd.attributes }
witEnd.content = empty
witEnd.attributes = att.global.attributes, att.rdgPart.attributes, empty
model.rdgPart |= witEnd

witList =
  ## (witness list) contains a list of all the witnesses referred to in
  ## wit elements or wit attributes
  ## within the critical apparatus.
  element witList { witList.content, witList.attributes }
witList.content = model.global*, (witness, model.global*)+
witList.attributes = att.global.attributes, empty
model.divPart |= witList

witStart =
  ## indicates the beginning, or resumption, of the text of a
  ## fragmentary witness.
  element witStart { witStart.content, witStart.attributes }
witStart.content = empty
witStart.attributes =
  att.global.attributes, att.rdgPart.attributes, empty
model.rdgPart |= witStart

witness =
  ## 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.
  element witness { witness.content, witness.attributes }
witness.content = macro.paraContent
witness.attributes =
  att.global.attributes,
  ## indicates which other witnesses are included in a witness group.
  attribute included { data.pointers }?,
  empty
# 3. macros
