TEI ODDities: Using an empty model class in TEI Pure ODD content
David Maus, 10. Dec 2022
In March 2022 the TEI Stylesheets Task Force commenced work on a new ODD to RELAX NG processor. With an early version of a transpiler in place it is time to explore some of the odd corners of the TEI schema specification language.
Today we look what happens if an element's content model refers to an empty model class. The following schema specification defines a document with an outermost element outermost-element
. The content model of the element is a reference to the model class
content-class-empty
. As it happens this model class is empty: No element defined in the schema
specification is declared to be a member of this class.
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>TEI ODDities: Using an empty model class in TEI Pure ODD content</title>
</titleStmt>
<publicationStmt>
<publisher>
<persName>David Maus</persName>
<email>dmaus@dmaus.name</email>
</publisher>
</publicationStmt>
<sourceDesc>
<p>born digital</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<body>
<schemaSpec ident="empty-model-class" start="outermost-element">
<classSpec type="model" ident="content-class-empty"/>
<elementSpec ident="outermost-element">
<content>
<classRef key="content-class-empty"/>
</content>
</elementSpec>
</schemaSpec>
</body>
</text>
</TEI>
The current stylesheets (TEI Edition: Version 4.4.0. Last updated on 19th April 2022, revision ff9cc28b0)
transpile the empty class to a notAllowed
pattern such that the resulting RELAX NG grammar forbids the use
of outermost-element
.
namespace sch = "http://purl.oclc.org/dsdl/schematron"
default namespace tei = "http://www.tei-c.org/ns/1.0"
namespace teix = "http://www.tei-c.org/ns/Examples"
namespace xlink = "http://www.w3.org/1999/xlink"
# Schema generated from ODD source 2022-12-09T06:32:19Z. .
# TEI Edition: Version 4.4.0. Last updated on
# 19th April 2022, revision ff9cc28b0
# TEI Edition Location: https://www.tei-c.org/Vault/P5/Version 4.4.0/
#
#
sch:ns [ prefix = "tei" uri = "http://www.tei-c.org/ns/1.0" ]
content-class-empty = notAllowed
outermost-element =
##
element outermost-element { content-class-empty }
start = outermost-element
I think that's wrong. Following the definition of classRef
a class reference without an expand
should be
understood as choice between the class members. If the class has no members, then the content model should be
empty
.