a corpus that demonstrates co-occurrence constraint via multiple declaration ODD hack
author: Syd Bauman

co-occurrence constraint via multiple declaration hack demo

In this contrived encoding language, when a <profileDesc> is in the <teiHeader> that is the child of the outermost <teiCorpus>, a <textDesc> child is not allowed; when a <profileDesc> is in a <teiHeader> that is the child of a <TEI> element, a <textDesc> is required.

The technique demonstrated here, which is somewhat complex, is based on the idea that you can define two different names for an element (or class): 1) The name as used in the schema and thus in the instance documents that conform to the schema, and 2) the name as it is used in RELAX NG patterns to refer to the element (or class). They are both typically defined by the @ident attribute. But if there is an <altIdent> child, it is used for (1) and @ident for (2).

ODD to demonstrate a co-occurrence constraint hack

model.corpusHeaderPart
groups high level elements which may appear more than once in the corpus header.

<corpusHeader>
teiHeader
corpus header
supplies descriptive and declarative metadata associated with a corpus.

<encodingDesc>

<xenoData>

<textDesc>

<profileDesc_corpus>
profileDesc

<profileDesc_document>
profileDesc

<teiCorpus>