namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace s = "http://www.ascc.net/xml/schematron"
namespace tei = "http://www.tei-c.org/ns/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/. 
#		Transcription of primary
# sources

# Definitions from module transcr

# Set global predeclared macros

# Set predeclared macros

# 0. predeclared macros

# 1. classes
att.global.facs.attributes = att.global.facs.attribute.facs, empty
att.global.facs.attribute.facs =
  ## (facsimile) points to all or part of an image which corresponds with
  ##       the content of the element.
  attribute facs {
    list { data.pointer+ }
  }?
att.coordinated.attributes =
  att.coordinated.attribute.ulx,
  att.coordinated.attribute.uly,
  att.coordinated.attribute.lrx,
  att.coordinated.attribute.lry,
  empty
att.coordinated.attribute.ulx =
  ## gives the x coordinate value for the upper left corner of a
  ## rectangular space.
  attribute ulx { data.numeric }?
att.coordinated.attribute.uly =
  ## gives the y coordinate value for the upper left corner of a
  ## rectangular space.
  attribute uly { data.numeric }?
att.coordinated.attribute.lrx =
  ## gives the x coordinate value for the lower right corner of a
  ## rectangular space.
  attribute lrx { data.numeric }?
att.coordinated.attribute.lry =
  ## gives the y coordinate value for the lower right corner of a
  ## rectangular space.
  attribute lry { data.numeric }?
# 2. elements

addSpan =
  ## (added span of text) marks the beginning of a longer sequence of text added by an
  ##   author, scribe, annotator or corrector (see also add).
  element addSpan { addSpan.content, addSpan.localattributes }
addSpan.content =
  empty
  >> s:pattern [
       name = "spanTo_required"
       "\x{a}" ~
       "      "
       s:rule [
         context = "tei:addSpan"
         "\x{a}" ~
         "        "
         s:assert [
           test = "@spanTo"
           "The spanTo= attribute of "
           s:name [ ]
           " is required."
         ]
         "\x{a}" ~
         "      "
       ]
       "\x{a}" ~
       "    "
     ]
addSpan.localattributes =
  att.global.attributes,
  att.transcriptional.attributes,
  att.placement.attributes,
  att.typed.attributes,
  att.spanning.attributes,
  empty

am =
  ## (abbreviation marker) contains a sequence of letters or signs present in an
  ##   abbreviation which are omitted or replaced in the expanded form of
  ##   the abbreviation.
  element am { am.content, am.localattributes }
am.content = macro.xtext
am.localattributes =
  att.global.attributes, att.editLike.attributes, empty

damage =
  ## contains an area of damage to the text witness.
  element damage { damage.content, damage.localattributes }
damage.content = macro.paraContent
damage.localattributes =
  att.global.attributes,
  att.typed.attributes,
  att.damaged.attributes,
  empty

damageSpan =
  ## (damaged span of text) marks the beginning of a longer sequence of text which is
  ##   damaged in some way but still legible.
  element damageSpan { damageSpan.content, damageSpan.localattributes }
damageSpan.content =
  empty
  >> s:pattern [
       name = "spanTo_required_for_damageSpan"
       "\x{a}" ~
       "      "
       s:rule [
         context = "tei:damageSpan"
         "\x{a}" ~
         "        "
         s:assert [
           test = "@spanTo"
           "The spanTo= attribute of "
           s:name [ ]
           " is required."
         ]
         "\x{a}" ~
         "      "
       ]
       "\x{a}" ~
       "    "
     ]
damageSpan.localattributes =
  att.global.attributes,
  att.damaged.attributes,
  att.typed.attributes,
  att.spanning.attributes,
  empty

delSpan =
  ## (deleted span of text) marks the beginning of a longer sequence of text deleted,
  ## marked as deleted, or otherwise signaled as superfluous or spurious by an
  ## author, scribe, annotator, or corrector.
  element delSpan { delSpan.content, delSpan.localattributes }
delSpan.content =
  empty
  >> s:pattern [
       name = "spanTo_required_for_delSpan"
       "\x{a}" ~
       "      "
       s:rule [
         context = "tei:delSpan"
         "\x{a}" ~
         "        "
         s:assert [
           test = "@spanTo"
           "The spanTo= attribute of "
           s:name [ ]
           " is required."
         ]
         "\x{a}" ~
         "      "
       ]
       "\x{a}" ~
       "    "
     ]
delSpan.localattributes =
  att.global.attributes,
  att.transcriptional.attributes,
  att.typed.attributes,
  att.spanning.attributes,
  empty

ex =
  ## (editorial expansion) contains a sequence of letters added by an editor or
  ##   transcriber when expanding an abbreviation.
  element ex { ex.content, ex.localattributes }
ex.content = macro.xtext
ex.localattributes =
  att.global.attributes, att.editLike.attributes, empty

facsimile =
  ## contains a representation of some written source in the form of
  ## a set of images rather than as transcribed or encoded text.
  element facsimile { facsimile.content, facsimile.localattributes }
facsimile.content = front?, (model.graphicLike | surface)+, back?
facsimile.localattributes =
  att.global.attributes, att.declaring.attributes, empty

fw =
  ## (forme work) contains a running head (e.g. a header, footer), catchword, or
  ##   similar material appearing on the current page.
  element fw { fw.content, fw.localattributes }
fw.content = macro.phraseSeq
fw.localattributes =
  att.global.attributes,
  att.placement.attributes,
  ## classifies the material encoded according to some useful typology.
  ## Sample values include: 1] header; 2] footer; 3] pageNum (page number); 4] lineNum (line number); 5] sig (signature); 6] catch (catchword)
  attribute type { data.enumerated }?,
  empty

handNotes =
  ## contains one or more handNote elements documenting the
  ## different hands identified within the source texts.
  element handNotes { handNotes.content, handNotes.localattributes }
handNotes.content = handNote+
handNotes.localattributes = att.global.attributes, empty

handShift =
  ## marks the beginning of a sequence of text written in a new
  ## hand, or the beginning of a scribal stint.
  element handShift { handShift.content, handShift.localattributes }
handShift.content = empty
handShift.localattributes =
  att.global.attributes,
  att.handFeatures.attributes,
  ## identifies the new hand.
  attribute new { data.code }?,
  ## signifies the editor or transcriber responsible for identifying
  ## the change of hand.
  attribute resp { data.code }?,
  empty

restore =
  ## indicates restoration of text to an earlier state by
  ## cancellation of an editorial or authorial marking or instruction.
  element restore { restore.content, restore.localattributes }
restore.content = macro.paraContent
restore.localattributes =
  att.global.attributes,
  att.transcriptional.attributes,
  att.typed.attributes,
  empty

space =
  ## indicates the location of a significant space in the copy text.
  element space { space.content, space.localattributes }
space.content = empty
space.localattributes =
  att.global.attributes,
  att.dimensions.attributes,
  ## (dimension) indicates whether the space is horizontal or vertical.
  attribute dim {
    ## the space is horizontal.
    "horizontal" | ## the space is vertical.
      "vertical"
  }?,
  ## (responsible party) indicates the individual responsible for identifying and measuring
  ## the space.
  attribute resp { data.pointer }?,
  empty

subst =
  ## (substitution) groups one or more deletions with one or more additions when
  ##   the combination is to be regarded as a single intervention in the text.
  element subst { subst.content, subst.localattributes }
subst.content =
  model.pPart.transcriptional, model.pPart.transcriptional+
subst.localattributes =
  att.global.attributes, att.transcriptional.attributes, empty

supplied =
  ## signifies text supplied by the transcriber or editor for any
  ##   reason, typically because the original cannot be read because of
  ##   physical damage or loss to the original.
  element supplied { supplied.content, supplied.localattributes }
supplied.content = macro.paraContent
supplied.localattributes =
  att.global.attributes,
  att.editLike.attributes,
  ## indicates why the text has had to be supplied.
  attribute reason {
    list { data.word+ }
  }?,
  empty

surface =
  ## defines a written surface in terms of a rectangular
  ## coordinate space, optionally  grouping one or more graphic representations of
  ## that space, and rectangular zones of interest
  ## within it.
  element surface { surface.content, surface.localattributes }
surface.content = model.glossLike*, model.graphicLike*, zone*
surface.localattributes =
  att.global.attributes,
  att.coordinated.attributes,
  att.declaring.attributes,
  ## points to an element which encodes the starting position of the text corresponding to the
  ## inscribed part of the surface.
  attribute start { data.pointer }?,
  empty

zone =
  ## defines a rectangular area contained within a surface
  ## element. 
  element zone { zone.content, zone.localattributes }
zone.content = model.glossLike*, model.graphicLike*
zone.localattributes =
  att.global.attributes, att.coordinated.attributes, empty
# 3. macros
