[go: up one dir, main page]

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

recent release seems to have broken some value lists #2597

Closed
sydb opened this issue Sep 21, 2024 · 6 comments
Closed

recent release seems to have broken some value lists #2597

sydb opened this issue Sep 21, 2024 · 6 comments

Comments

@sydb
Copy link
Member
sydb commented Sep 21, 2024

A <valList type="closed"> should generate a controlled list of possible (string) values in the RELAX NG, along with an annotation list of those values (for oXygen or other tool to use as pop-up or other UX), and a “legal values are” list in the documentation.
In release 4.8.0 some do not. To convince myself I looked at

  • The @type of <tag> in both 4.7.0 documentation vs 4.8.0 documentation and 4.7.0 RNC vs 4.8.0 RNC — obviously current (4.8.0) release is broken for this "closed" list.
  • The @type and @level of <title> in both 4.7.0 documentation vs 4.8.0 documentation and 4.7.0 RNC vs 4.8.0 RNC — I was surprised to find it is @type (an "open" value list) that is missing its values in 4.8.0 documentation, not @level (a "closed" value list).
  • @status and @method of <correction> in documentation and RNC — seem to be fine, as do pc/@force and space/@dim.

So I am very confused about when a value list is being dropped. Might be positional, might be based on presence of <defaultVal>, might be something else. But given that, at least in some cases, the output is broken (although not wrong), this strikes me as a relatively urgent issue that may well deserve a patch release. (I have given it the 7.58.0 milestone, as we do not have a 7.57.1 milestone :-)

@raffazizzi
Copy link
Contributor

After comparing Stylesheets in release 7.56.0 (which work as expected) and 7.57.0 (which does not), I have found that the difference causing the issue is in /source/p5subset.xml.

So there is nothing to blame in the Stylesheets (at least in terms of changes made for the last stable release). What has changed between release 7.56.0 and 7.57.0 that is causing the issue is p5subset.

p5subset in 7.56.0 has

<elementSpec module="tagdocs" ident="tag">
  ...
  <attDef ident="type" mode="change" usage="opt">
     ...
     <valList type="closed" mode="add"> 

While p5subset in 7.57.0 does not have mode="add" on the valList, which is causing it to fall through the cracks

So we either make sure that implicit mode="add"s are processed correctly, or we restore explicit mode="add"s in the places where we removed them.

@sydb
Copy link
Member Author
sydb commented Sep 25, 2024

Excellent, thank you @raffazizzi!

As for the two proposed solutions, seems to me explicitly adding mode="add" in our declarations in the Guidelines source is a relatively easy fix we can implement almost right away. But that won’t fix the same problem occurring in other people’s ODDs, so I think we need to fix processing of implicit mode="add" whether we implement the easy fix for P5 or not. (That is, changing our declarations does not relieve us of the obligation to fix the processing, but it does mean we could fix it at a normal pace, rather than as a hot-mess, high-priority, emergency.)

The good news is that in this case (as far as I can tell) there is no problematic conflict between the declaration of @mode and the prose description of it. (As there sort of is for some other cases.)

In this case, att.combinable defines the default value of @mode to be "add"; and chapter TD explicitly says that mode="change" means “process identifiable children according to their modes; process unidentifiable children in replace mode; retain existing children where no replacement or change is provided”.

Thus if @mode is missing on a child of something that has @mode="change" (and for which there is another specification), the default of "add" should just be honored.

@sydb
Copy link
Member Author
sydb commented Sep 25, 2024

I have taken a look (using [1]), and it seems as though there are 44 cases of missing @mode="add" on <valList> inside <attDef mode="change"> in the current p5subset, all on re-definitions of @type.

[1]

for path in $(xsel -t -m "//t:attDef[@mode='change'][t:valList[@mode='add']]" -v 'concat("//t:elementSpec[@ident=%", ../../@ident,"%]/t:attList/t:attDef[@ident=%", @ident, "%]/t:valList")' -n Stylesheets_7.56.0/source/p5subset.xml | perl -pe "s,%,',g;") ; do echo "---------$path:" ; xsel -t -m $path -v "@mode" -n Stylesheets_7.57.0/source/p5subset.xml ; done

@sydb
Copy link
Member Author
sydb commented Oct 3, 2024

Although we may want the Stylesheets to handle this better, the current crisis-fix is to put mode="add" back, reverting #2520. Thus I am moving this ticket to the TEI repo.

@sydb sydb transferred this issue from TEIC/Stylesheets Oct 3, 2024
sydb added a commit that referenced this issue Oct 3, 2024
Put mode="add" back on valList elements per #2597.
@lb42
Copy link
Member
lb42 commented Oct 3, 2024

Fwiw, I just observed similar weird behaviour in an ODD which redefines @type to use a closed valList. With mode='add' , the schema did the right thing, but the doc did not display the legal values. I changed it to mode="replace" and everything seemed to be OK.

@HelenaSabel
Copy link
Member

Closed via TEIC/Stylesheets#706

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

No branches or pull requests

4 participants