TEIC / TEI

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

Deprecation of `classSpec/@generate` and `classRef/@expand` with alternative solutions. #2549

Open raffazizzi opened 1 month ago

raffazizzi commented 1 month ago

This PR is work in progress to address issue #2369

sydb commented 1 month ago

Sorry, I am still not convinced that having <classRef> as a child of <alternate> or <interleave> will be sufficient. So bear with me while I think this through aloud.

We are talking about references to classes that are currently expandable into one of:

We are planning to drop the "sequence" possibilities because we have no mechanism of determining a good sequence or allowing a customizer to change it. But we are (or at least I am) hoping to add interleave capability. In which case we need to be able to represent the parallel structures: "interleave" (( a & b & c )), "interleaveOptional" (( a? & b? & c? )), "interleaveRepeatable" (( a+ & b+ & c+)), and "interleaveOptionalRepeatable" (`( a & b & c )`).

I don’t think there is any way to represent those 4 possibilities just by noticing that the parent of <classRef> is <interleave>. Besides, what if I wanted an interleave of the classes, not of the elements that are members the classes? E.g., we would like the content model of <respStmt> to be

  <interleave>
    <elementRef key="resp" minOccurs="1" maxOccurs="unbounded"/>
    <classRef key="model.nameLike.agent" minOccurs="1" maxOccurs="unbounded"/>
  </interleave>

(We can’t do that, of course, because we can’t use <interleave>, as it has no equivalent in the DTD language.) That is, we want a minimum of <resp> and one of the nameLike.agent elements, not all of them.

So I think I have now convinced myself that being a child of <interleave> does not cut it. We need a tighter mechanism to specify the expansion of a class reference. (By “tighter” I mean tied closer to the class reference itself.)

raffazizzi commented 1 month ago

Would it suffice to add an attribute to <interleave> to indicate the type of interleaving desired?

martindholmes commented 1 month ago

We could add an attribute to classRef:

@use="members", @use="class", or

@use="one", @use="any", or @use="all"