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 declarefs

# Set predeclared macros

# 0. predeclared macros

# 1. classes

# 2. elements

bicond =
  ## (bi-conditional feature-structure constraint) defines a biconditional feature-structure constraint; both
  ## consequent and antecedent are specified as feature structures or groups
  ## of feature structures; the constraint is satisfied if both
  ## subsume a given feature structure, or if both do not.
  element bicond { bicond.content, bicond.attributes }
bicond.content = (fs | f), iff, (fs | f)
bicond.attributes = att.global.attributes, empty

cond =
  ## (conditional feature-structure constraint) defines a conditional feature-structure constraint; the consequent
  ## and the antecedent are specified as feature structures or
  ## feature-structure groups; the constraint is satisfied if both the
  ## antecedent and the consequent subsume a given feature
  ## structure, or if the antecedent does not.
  element cond { cond.content, cond.attributes }
cond.content = (fs | f), then, (fs | f)
cond.attributes = att.global.attributes, empty

fDecl =
  ## (feature declaration) declares a single feature, specifying its name, organization,
  ## range of allowed values, and optionally its default value.
  element fDecl { fDecl.content, fDecl.attributes }
fDecl.content = fDescr?, vRange, vDefault?
fDecl.attributes =
  att.global.attributes,
  ## indicates the name of the feature being declared; matches the
  ## name attribute of f elements in the text.
  attribute name { data.name },
  ## specifies the organizing discipline of the feature value.
  [ a:defaultValue = "unit" ]
  attribute org {
    ## (unitary atomic value) 
    "unit" | ## (set value (unordered, no duplicates)) 
      "set" | ## (bag value (unordered, may have duplicates)) 
      "bag" | ## (list value (ordered, may have duplicates)) 
      "list"
  }?,
  empty

fDescr =
  ## (feature description (in FSD)) describes in prose what is represented by the feature being
  ## declared and its values.
  element fDescr { fDescr.content, fDescr.attributes }
fDescr.content = macro.paraContent
fDescr.attributes = att.global.attributes, empty

fsConstraints =
  ## (feature-structure constraints) specifies constraints on the content of well formed feature
  ## structures.
  element fsConstraints {
    fsConstraints.content, fsConstraints.attributes
  }
fsConstraints.content = (cond | bicond)*
fsConstraints.attributes = att.global.attributes, empty

fsDecl =
  ## (feature structure declaration) declares one type of feature structure.
  element fsDecl { fsDecl.content, fsDecl.attributes }
fsDecl.content = fsDescr?, fDecl+, fsConstraints?
fsDecl.attributes =
  att.global.attributes,
  ## gives a name for the type of feature structure being declared.
  attribute type { data.enumerated },
  ## gives the name of the feature structure type from which this
  ## type inherits features and constraints; if this type declares a feature
  ## with the same name as a feature of the base type, the definition within
  ## this fsDecl overrides the inherited definition.  The
  ## fsConstraints are inherited only if this fsDecl
  ## does not specify any; otherwise the constraints in this fsDecl
  ## override.  When no baseType is specified, no features
  ## or constraints are inherited.
  attribute baseType { data.name }?,
  empty

fsDescr =
  ## (feature system description (in FSD)) describes in prose what is represented by the type of feature
  ## structure declared in the enclosing fsDecl.
  element fsDescr { fsDescr.content, fsDescr.attributes }
fsDescr.content = macro.paraContent
fsDescr.attributes = att.global.attributes, empty

if =
  ## defines a conditional default value for a feature; the condition
  ## is specified as a feature structure, and is met if it
  ## subsumes the feature structure in the text for which a
  ## default value is sought.
  element if { if.content, if.attributes }
if.content = (fs | f), then, model.featureVal
if.attributes = att.global.attributes, empty

iff =
  ## separates the condition from the consequence in a bicond
  ## element.
  element iff { iff.content, iff.attributes }
iff.content = empty
iff.attributes = att.global.attributes, empty

teifsd =
  ## (feature system declaration) contains a feature system declaration.
  element teifsd { teifsd.content, teifsd.attributes }
teifsd.content = teiHeader, fsDecl+
teifsd.attributes = att.global.attributes, empty

then =
  ## separates the condition from the default in an if, or
  ## the antecedent and the consequent in a cond element.
  element then { then.content, then.attributes }
then.content = empty
then.attributes = att.global.attributes, empty

vDefault =
  ## (value default) declares the default value to be supplied when a feature structure
  ## does not contain an instance of f for this name; if
  ## unconditional, it is specified as one (or, depending on the value of
  ## the org attribute of the enclosing fDecl) more
  ## fs elements or primitive values;
  ## if conditional, it is specified as
  ## one or more if elements; if no default is specified, or no
  ## condition matches, the value none is assumed.
  element vDefault { vDefault.content, vDefault.attributes }
vDefault.content = model.featureVal+ | if+
vDefault.attributes = att.global.attributes, empty

vRange =
  ## (value range) defines the range of allowed values for a feature, in the form of
  ## an fs, vAlt, or primitive value;
  ## for the value of an f to be valid, it must be
  ## subsumed by the specified range; if the f
  ## contains multiple values (as sanctioned by the org attribute),
  ## then each value must be subsumed by the vRange.
  element vRange { vRange.content, vRange.attributes }
vRange.content = model.featureVal
vRange.attributes = att.global.attributes, empty
# 3. macros
