Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

raffazizzi
Copy link
Contributor

@raffazizzi raffazizzi commented Apr 13, 2024

This PR is work in progress to address issue #2369

  • Deprecate @generate on <classSpec> and implement a 6-month deprecation period.
  • Replace @expand on <classRef> in the 4 instances where it is mentioned in the Guidelines with <elementRef>s
  • Deprecate @expand on <classRef> for 6 months, and make <classRef> a child of <alternate> instead (and potentially <interleave> once added. See Add interleave element (and deprecate sequence/@preserveOrder)  #2538.
  • Adjust guidelines accordingly.

@sydb
Copy link
Member

sydb commented Apr 20, 2024

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:

  • "alternation" (( a | b | c ), the default),
  • "sequence" (( a, b, c )),
  • "sequenceOptional" (( a?, b?, c? )),
  • "sequenceRepeatable" (( a+, b+, c+)), and
  • "sequenceOptionalRepeatable" (( a*, b*, c* )).

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
Copy link
Contributor Author

raffazizzi commented Apr 29, 2024

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

@raffazizzi raffazizzi self-assigned this Apr 29, 2024
@martindholmes
Copy link
Contributor

We could add an attribute to classRef:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants