TEIC / Stylesheets

TEI XSL Stylesheets
228 stars 124 forks source link

att.repeatable attributes have no effect on `<sequence>` or `<alternate>` #627

Closed sydb closed 4 months ago

sydb commented 9 months ago

I have pretty much convinced myself that @minOccurs and @maxOccurs do nothing when they are attributes of <sequence> or <alternate> (as opposed to on <elementRef> or <classRef>, where they work fine; or on <anyElement> or <datatype> where I have not performed thorough tests).

I will attach a demo ODD that demonstrates the problem shortly.

Anyone who wants to help with this, please feel free to assign yourself.

sydb commented 9 months ago

issue_627.zip Why does Github support .zip, but not .tgz? Harumph!

sydb commented 9 months ago

Wow. Just noticed that this bug has at least one real sequela in the Guidelines: If you look at the content model for <choice>, you will see that it is defined as 2+ occurrences of either a member of model.choicePart or another <choice>:

  <alternate minOccurs="2" maxOccurs="unbounded">
    <classRef key="model.choicePart"/>
    <elementRef key="choice"/>
  </alternate>

HOWEVER, if you look at the schema declaration, you will see that it is defined there as only 1+ occurrences of either a member of model.choicePart or another <choice>:

element choice {
   ( model.choicePart | choice )+
}

That has gone unnoticed for many years, I am sure. (The output should be something like either ( ( model.choicePart | choice ), ( model.choicePart | choice )+ ) or ( ( model.choicePart | choice ), ( model.choicePart | choice ), ( model.choicePart | choice )* ), but my code on branch sydb_627 is not quite working, yet.)