TEIC / TEI

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

on constraint (of attribute alternation) duplication #2378

Open sydb opened 1 year ago

sydb commented 1 year ago

Introduction

There are 6 uses of <attList org="choice"> in the Guidelines:

(See below for glossary of column headings.) element attributes works? +cS? note
<anyElement> @include, @except NO no [1,2]
<classRef> @include, @except yes no
<dataRef> @key, @name, @ref yes no
<moduleRef> @include, @except yes yes
<moduleRef> @key, @url yes yes
<relation> @active, @mutual yes yes [3]

Major Problem (not this ticket)

In at least one case of elementSpec//attList[@org eq 'choice'] it does not work. IIRC, it also never works in cases of over-riding an attribute defined in a class. But those are problems for the Stylesheets repo, not this repo.

Secondary Problem (this ticket)

I think we should consistently have an additional <constraintSpec> in all cases or (better yet) not have it in any cases.

Tertiary Finding

(This ticket, but only because there were other problems; this one is a small, corrigible error I would have just fixed in dev without discussion. But since the discussion here might result in “just delete it” …)

The <constraintSpec ident="not-except-and-include"> in <moduleRef> is misplaced. (It is a child of the "prefix" attribute definition; it should be the child of either the "except" or "include" attribute definition.)

Notes

[1] @martindholmes actually has a (not unreasonable) use case for allowing both attributes, anyway. [2] See also #2357. [3] There is an interesting annotation in an XML comment in the <constraintSpec>: “this constraint is pointless in RELAX NG land, where the org=choice works. It is useful in DTD land, where the attList/@org has no effect. It looks to me like it is useful in W3C XML Schema land, too, which I find suprising, as I thought XSD could express a disjuntion like that w/o difficulty. (But I may be reading the XSD incorrectly.) — Syd, 2018-05-01”.

ebeshero commented 1 year ago

Linking to https://github.com/TEIC/TEI/issues/2140 . Isn't the use of attList[org="choice"] in <elementSpec> relevant here as well?