TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
276 stars 88 forks source link

Add `interleave` element (and deprecate `sequence/@preserveOrder`) #2538

Open joeytakeda opened 6 months ago

joeytakeda commented 6 months ago

Resolves #2154 by adding the interleave element and deprecating sequence/@preserveOrder

At the moment, I'm leaving this as draft as per @hcayless' observation that we should figure out how best to validate the defined content model to prevent overlap. IMO, we should probably warn about this in the prose and in the remarks for the element, but true validation will probably need to be left up to the ODD processor.

joeytakeda commented 5 months ago

Moving this to be ready for review, since I think the question of validity is probably something that needs to be handled by the processor (but have assigned mostly ATOP folks for review to see what they think about that)

sydb commented 4 months ago

Just to make the concern initially raised by @hcayless (on the ticket) echoed by @joeytakeda (here) explicit …

In RELAX NG it is not legal to have the same element occur in an interleave more than once. And because interleave “reaches in” to the patterns listed, this is hard to check for (other than by running a RELAX NG processor like jing … I just discovered that neither trang nor nxml-mode object).

So, for example, the following is not allowed in RELAX NG:

start = element blood { ( a & b & o & ab ) }

a = element a { empty }
b = element b { empty }
o = element o { empty }
ab = ( a | b )

And it does not matter whether the ab pattern is defined as an alternation (<rng:choice> or |), a sequence (<rng:group> or ,), or an interleave (<rng:interleave> or &). In all cases the reference to the pattern ab throws an error. (The message is “the element "b" can occur in more than one operand of "interleave"”, which I, for one, find confusing.)