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

# Schema generated 2008-11-01T14:14:38Z
# Edition: 1.2.0. Last updated on October 31st 2008.
# Copyright 2008 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.
# A copy of the GNU General Public
#	    License is stored on the TEI web site
#	    along with this file; you can also contact the Free
#	    Software Foundation, Inc., 59 Temple Place, Suite 330,
#	    Boston, MA 02111-1307, USA, for a copy.
# For information about the TEI, including contact
#		details, consult the TEI web
#	      site at http://www.tei-c.org/. 
#		Critical Apparatus

# Definitions from module textcrit

# Set global predeclared macros

# Set predeclared macros

# 0. predeclared macros

# 1. classes
model.rdgLike = rdg
model.rdgLike_sequence = rdg
model.rdgLike_sequenceOptional = rdg?
model.rdgLike_sequenceOptionalRepeatable = rdg*
model.rdgLike_sequenceRepeatable = rdg+
model.rdgPart = wit | witStart | witEnd | lacunaStart | lacunaEnd
model.rdgPart_sequence = wit, witStart, witEnd, lacunaStart, lacunaEnd
model.rdgPart_sequenceOptional =
  wit?, witStart?, witEnd?, lacunaStart?, lacunaEnd?
model.rdgPart_sequenceOptionalRepeatable =
  wit*, witStart*, witEnd*, lacunaStart*, lacunaEnd*
model.rdgPart_sequenceRepeatable =
  wit+, witStart+, witEnd+, lacunaStart+, lacunaEnd+
att.rdgPart.attributes = att.rdgPart.attribute.wit, empty
att.rdgPart.attribute.wit =
  ## (witness or witnesses) contains a list of one or more sigla indicating the witnesses
  ## which begin or end at this point.
  attribute wit {
    list { data.pointer+ }
  }?
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,
  empty
att.textCritical.attribute.wit =
  ## (witness or witnesses) contains a list of one or more pointers indicating the witnesses
  ## which attest to a given reading.
  attribute wit {
    list { data.pointer+ }
  }?
att.textCritical.attribute.type =
  ## classifies the reading according to some useful typology.
  ## Sample values include: 1] substantive; 2] orthographic
  attribute type { data.enumerated }?
att.textCritical.attribute.cause =
  ## 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
  attribute cause { data.enumerated }?
att.textCritical.attribute.varSeq =
  ## (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.
  attribute varSeq { data.count }?
att.textCritical.attribute.resp =
  ## (responsible party) 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.localattributes }
app.content =
  model.global*,
  (lem, model.global*, (wit, model.global*)?)?,
  ((model.rdgLike, model.global*, (wit, model.global*)?)
   | (rdgGrp, model.global*, (wit, model.global*)?))*
app.localattributes =
  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 }?,
  ## (location) indicates the location of the variation, when the
  ## location-referenced method of apparatus markup is used.
  attribute loc {
    list { data.word+ }
  }?,
  empty

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

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

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

listWit =
  ## (witness list) lists definitions for all the witnesses referred to by a critical
  ##   apparatus, optionally grouped hierarchically.
  element listWit { listWit.content, listWit.localattributes }
listWit.content = model.headLike?, (witness | listWit)+
listWit.localattributes = att.global.attributes, empty

rdg =
  ## (reading) contains a single reading within a textual variation.
  element rdg { rdg.content, rdg.localattributes }
rdg.content =
  (text
   | model.gLike
   | model.phrase
   | model.inter
   | model.global
   | model.rdgPart)*
rdg.localattributes =
  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.localattributes }
rdgGrp.content =
  ((rdgGrp, wit?)
   | ((lem, wit?)?, (model.rdgLike, wit?))*)+
rdgGrp.localattributes =
  att.global.attributes, att.textCritical.attributes, empty

variantEncoding =
  ## declares the method used to encode text-critical variants.
  element variantEncoding {
    variantEncoding.content, variantEncoding.localattributes
  }
variantEncoding.content = empty
variantEncoding.localattributes =
  att.global.attributes,
  ## indicates which method is used to encode the apparatus of
  ## variants.
  attribute method {
    ## apparatus uses line numbers or other canonical reference scheme
    ## referenced in a base text.
    "location-referenced" | ## apparatus indicates the precise locations of the beginning and
      ## ending of each lemma relative to a base text.
      "double-end-point" | ## alternate readings of a passage are given in parallel in the
      ## text; no notion of a base text is necessary.
      "parallel-segmentation"
  },
  ## indicates whether the apparatus appears within the running text
  ## or external to it.
  attribute location {
    ## apparatus appears within the running text.
    "internal" | ## apparatus appears outside the base text.
      "external"
  },
  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.localattributes }
wit.content = macro.phraseSeq
wit.localattributes =
  att.global.attributes, att.rdgPart.attributes, empty

witDetail =
  ## (witness detail) gives further information about a particular witness, or
  ## witnesses, to a particular reading.
  element witDetail { witDetail.content, witDetail.localattributes }
witDetail.content = macro.phraseSeq
witDetail.localattributes =
  att.global.attributes,
  att.placement.attributes,
  ## indicates the identifier for the reading, or readings, to which
  ## the witness detail refers.
  attribute target {
    list { data.pointer+ }
  },
  ## (responsible party) identifies the individual responsible for  identifying the
  ## witness
  attribute resp { data.pointer }?,
  ## (witnesses) indicates the sigil or sigla for the witnesses to which the
  ## detail refers.
  attribute wit { data.pointer },
  ## describes the type of information given about the witness.
  attribute type { data.enumerated }?,
  empty

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

witStart =
  ## (fragmented witness start) indicates the beginning, or resumption, of the text of a
  ## fragmentary witness.
  element witStart { witStart.content, witStart.localattributes }
witStart.content = empty
witStart.localattributes =
  att.global.attributes, att.rdgPart.attributes, empty

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.localattributes }
witness.content = macro.limitedContent
witness.localattributes = att.global.attributes, empty
# 3. macros
