Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 65 additions & 10 deletions P5/Source/Specs/alternate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,73 @@
<memberOf key="model.contentPart"/>
</classes>
<content>
<alternate minOccurs="1" maxOccurs="unbounded">
<elementRef key="valList"/>
<classRef key="model.contentPart"/>
<!--
What we would like to have is
<interleave>
<classRef key="model.contentPart" minOccurs="1" maxOccurs="unbounded"/>
<alternate>
<classRef key="model.contentPart" minOccurs="1" maxOccurs="1"/>
<elementRef key="valList" minOccurs="0" maxOccurs="1">
</alternate>
</interleave>
OR, equivalently,
( model.contentPart+ & ( model.contentPart | valList? ) )
but
a) that is not valid in RELAX NG, anyway (because
model.contentPart is a member of an interleave
more than once); and
b) even if it were it probably could not be converted to DTD (or to XSD?)
due to ambiguity.

So the following mildly complex content model does the same
thing without use of <interleave> and in an unambiguous way.
(Thus it can be converted to a valid DTD.)
Here is a briefly annotated version of the ODD content model
that follows, expressed using the RELAX NG compact syntax
instead:
(
( valList, model.contentPart+ ) # starts with <valList>
| # (and is followed by %contentPart;s)
( # OR
model.contentPart, # starts with %contentPart;
( # which is followed by
valList # <valList>
| # or
( model.contentPart+, valList? ) # more %contentPart;s and maybe a <valList>
)
)
)
-->
<alternate minOccurs="1" maxOccurs="1">
<!--
Two possible sets of children: my content either starts with
<valList> or with a member of model.contentPart.
-->
<sequence minOccurs="1" maxOccurs="1">
<!-- Content starts with <valList> is simple: a single
<valList> followed by one or more members of
model.contentPart: -->
<elementRef key="valList" minOccurs="1" maxOccurs="1"/>
<classRef key="model.contentPart" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<sequence minOccurs="1" maxOccurs="1">
<!-- Content starts with a member of model.contentPart is not
as simple: after the single initial member of
model.contentPart we could either have just a <valList>
(for a total of 2 children) or we could have an
additional one or more members of model.contentPart,
optionally followed by a <valList>. -->
<classRef key="model.contentPart" minOccurs="1" maxOccurs="1"/>
<alternate minOccurs="1" maxOccurs="1">
<elementRef key="valList" minOccurs="1" maxOccurs="1"/>
<sequence minOccurs="1" maxOccurs="1">
<classRef key="model.contentPart" minOccurs="1" maxOccurs="unbounded"/>
<elementRef key="valList" minOccurs="0" maxOccurs="1"/>
</sequence>
</alternate>
</sequence>
</alternate>
</content>
<constraintSpec ident="alternatechilden" scheme="schematron" xml:lang="en">
<constraint>
<sch:rule context="tei:alternate">
<sch:assert test="count(*) gt 1">The alternate element must have at least two child elements</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<exemplum xml:lang="en">
<egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-alternate-egXML-eg" xml:lang="en" source="#UND"><content>
<alternate>
Expand Down
3 changes: 2 additions & 1 deletion P5/Source/Specs/closer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<gloss versionDate="2007-06-12" xml:lang="en">closer</gloss>
<gloss versionDate="2022-06-16" xml:lang="es">cierre</gloss>
<gloss versionDate="2007-06-12" xml:lang="fr">formule finale</gloss>
<desc versionDate="2007-04-06" xml:lang="en">groups together salutations, datelines, and similar phrases appearing as a final group at
<desc versionDate="2007-04-06" xml:lang="en">groups together salutations, datelines, bylines, and similar phrases appearing as a final group at
the end of a division, especially of a letter.</desc>
<desc versionDate="2007-12-20" xml:lang="ko">구역의 마지막, 특히 편지의 종료부에 발문으로 나타나는 인사말, 날짜 표시란, 그리고 유사 구를 합하여
모아 놓는다.</desc>
Expand All @@ -31,6 +31,7 @@ aparecen en la última sección al final de una división, especialmente en una
<alternate minOccurs="0" maxOccurs="unbounded">
<textNode/>
<classRef key="model.gLike"/>
<elementRef key="byline"/>
<elementRef key="signed"/>
<elementRef key="dateline"/>
<elementRef key="salute"/>
Expand Down
9 changes: 1 addition & 8 deletions P5/Source/Specs/interleave.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@
<memberOf key="model.contentPart"/>
</classes>
<content>
<classRef key="model.contentPart" maxOccurs="unbounded"/>
<classRef key="model.contentPart" minOccurs="2" maxOccurs="unbounded"/>
</content>
<constraintSpec ident="interleavechilden" scheme="schematron" xml:lang="en">
<constraint>
<sch:rule context="tei:interleave">
<sch:assert test="count(*) gt 1">The interleave element must have at least two child elements</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<exemplum xml:lang="en">
<egXML xmlns="http://www.tei-c.org/ns/Examples" xml:lang="en" source="#UND">
<content>
Expand Down
12 changes: 2 additions & 10 deletions P5/Source/Specs/sequence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@
<memberOf key="model.contentPart"/>
</classes>
<content>
<classRef key="model.contentPart" maxOccurs="unbounded"/>
<classRef key="model.contentPart" minOccurs="2" maxOccurs="unbounded"/>
</content>
<constraintSpec ident="sequencechilden" scheme="schematron" xml:lang="en">
<constraint>
<sch:rule context="tei:sequence">
<sch:assert test="count(*) gt 1">The sequence element must have at least two child elements</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<attList>
<attDef ident="preserveOrder" validUntil="2026-06-15">
<desc type="deprecationInfo" versionDate="2024-03-15" xml:lang="en">The <att>preserveOrder</att> on <gi>sequence</gi> has been deprecated. The <gi>interleave</gi> element should be used to denote unordered constructs.</desc>
<desc xml:lang="en" versionDate="2023-03-21">if false, indicates that
component elements of a sequence may occur in any order.</desc>
<desc xml:lang="en" versionDate="2023-03-21">if false, indicates that component elements of a sequence may occur in any order.</desc>
<datatype><dataRef key="teidata.truthValue"/></datatype>
</attDef>
</attList>
Expand Down