-
Notifications
You must be signed in to change notification settings - Fork 88
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
Bug in overridden vallists #2128
Comments
There are 21 element specs with the same problem. |
Other possible victim elements from a quick XPath: |
@JanelleJenstad @martindholmes @sydb This seems weirdly relevant to our discussion of TEIC/Stylesheets#272 yesterday, over behavior of mode attributes related to vallists. |
Yes, schemas affected. Yes, I think an interim release would be appropriate. I will try to investigate further later this weekend. |
This does raise an interesting question about the
In this case, it appears that the first is in effect, so I'm coming around to the idea that we should insist on |
Working on this in branch issue-2128-valLists. |
PR #2129 is live -- please review and merge. |
I disagree — having what I think it is supposed to be, and what I vaguely recall Sebastian implying, is that it is inherited; if there is nothing to inherit, it is <xsl:variable name="mode" value="( ancestor::*[@mode][1]/@mode, 'add' )[1]"/> but was probably quite a pain to do in XSLT 1. Thus I strongly suspect there is just a bug(s) in the Stylesheets. |
@sydb Adding |
Where does the idea that the default value for @mode is (in old money) #INHERITED come from? Sfaicr, it is always ADD. |
p.s, yes please fix this asap -- it also affects anyone trying to document their own ODD properly |
@lb42 No idea where the inheritance idea comes from, other than I seem to recall it being mentioned in a discussion the Stylesheets Working Group was having when looking at TEIC/Stylesheets#272. Maybe I'm misremembering. That would be excellent -- if that's not a thing, then it's much easier to describe what should happen in cascading |
I have just tested and get the same results using the more semantically correct (IMHO) Tests I ranTo compare the two I checked out two different local copies of the issue-2128-valLists branch, and changed the 22 files that had new mode=add to mode=change (using an Emacs macro, as I only wanted to change the very same line @martindholmes had changed, not any other cases of mode=add). I than (roughly simultaneously) ran |
I think if there was no valList in the class (which there isn't), and you provide one in the elementSpec, then it should be "add". |
Hmmm … Makes some sense. But why should you, the ODD writer, need to figure out whether or not there was a |
IIRC, |
Detection and reporting of error conditions is not one of the odd processing tool chains strengths |
I think "add" is strictly correct in this context, but if a valList were to be added to the type attribute in the class (which it never will be), the processing should raise an error or a warning suggesting changing it to "change". I still think the PR as it stands is the correct fix. |
I sought guidance from the Guidelines, but am still uncertain, I’m afraid. The last bit of TDbuild says that if you (the processor) are working on some declaration with
Which begs the question (already being toyed with in this discussion) about what is the default value of |
If there were an ancestor valList, surely the required value to replace it would be "replace". I don't see how "change" makes any sense, unless you have some child valItems that you're going to keep and some new ones you're going to add. This is unlikely to happen with |
In any case, I think this is an issue for another ticket. The immediate urgency is to fix the missing things, and it makes more sense to fix them using the same attribute value that's been used to create the same output for all their colleague elements in the same situation which are not broken. |
What makes you think My instinct is the harm in using the wrong one is pretty minimal, so I do not wan to delay this for long over the |
|
But that only tells us about overrides of att.typed (by far the most common, of course). |
Interestingly, if I checkout 8995b48 (the commit before the change that I think caused the problem), build p5subset.xml, and run that XPath on it (for each hitting spitting out
Which is only 5 of the 22. Hmmm … |
Yes, I was only looking for att.typed overrides because virtually every commit linked to issue #386 was on att.typed items. |
I worry a little that a lengthy discussion of the history will give Council members the impression that there's a debate to be had about whether or how this should be fixed in the short term. There isn't. This is bad and it should be fixed as soon as possible. People's ODDs and schemas are broken, and the Guidelines are currently missing lots of key info. Please let's fix this quickly, and then go back to the thorny issue of what |
@martindholmes I'm just trying to catch up on what I missed over the weekend. In which cases are ODDs and schemas broken? Do you have an example? I tried to reproduce one, but I did not succeed. |
@martinascholger If you go here: https://tei-c.org/release/doc/tei-p5-doc/en/html/ref-tag.html you'll see that the valList for https://tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng (Lines 19752ff). There are a bunch of other elements also missing their valLists. Up to 3.6.0, these elements had their own locally-defined type attributes. Then they were added to the att.typed class, and the attribute was overridden at the elementSpec level, but no mode attribute was supplied on the valList, so the values have just been missing ever since. |
Yes, but that does not automatically mean that the ODDs and schemas are broken, but that they do not validate the values correctly, or? I just wonder why we did not notice it for a while. There is no question that we need to fix this. |
They're broken in the sense that where previously people would have got suggested values popping up in Oxygen, suddenly those values would disappear; and if any of these valLists were closed, encoders would suddenly have been able to add bad values that would have been caught by validation before, but would now be allowed. I didn't mean the schemas were technically invalid or anything like that; just that they would cause problems for projects using them. That's how @JanelleJenstad and I found the problem in the first place; we couldn't understand why the values for |
@martindholmes sums it up nicely. After we noticed the problem on Friday, Martin and I were speculating last week about why people hadn't noticed. I only noticed because I was writing documentation for one of our own projects and wanted to double-check what values are allowed on |
Thanks @JanelleJenstad and @martindholmes ! |
@npcole offered to do the point release. |
Thanks everyone! I'm closing this ticket now. |
Have a look at the element spec for tag (https://tei-c.org/release/doc/tei-p5-doc/en/html/ref-tag.html). There should be a custom vallist, but it's not displaying. We think there's an error in the spec file. Bug occurred between 3.6 (which has the values) and 4.0.0 (which doesn't have the values). vallist should have mode=add
The text was updated successfully, but these errors were encountered: