-
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
Create an interleave element #2154
Comments
@sydb and I believe that:
Advantages:
Disadvantages:
|
Note that we chose the name Thus: <alternate minOccurs="1" maxOccurs="1">
<bag minOccurs="1" maxOccurs="1">
<elementRef key="sic" minOccurs="1" maxOccurs="1"/>
<elementRef key="corr" minOccurs="1" maxOccurs="1"/>
</bag>
<bag minOccurs="1" maxOccurs="1">
<elementRef key="abbr" minOccurs="1" maxOccurs="1"/>
<elementRef key="expan" minOccurs="1" maxOccurs="1"/>
</bag>
<bag minOccurs="1" maxOccurs="1">
<elementRef key="orig" minOccurs="1" maxOccurs="1"/>
<elementRef key="reg" minOccurs="1" maxOccurs="1"/>
</bag>
</alternate> would be a perfectly reasonable customized content model for <bag>
<elementRef key="one"/>
<elementRef key="two"/>
<elementRef key="five"/>
<elementRef key="three"/>
<elementRef key="three"/>
</bag> and thus is precisely equivalent to <bag>
<elementRef key="one" minOccurs="1" maxOccurs="1"/>
<elementRef key="two" minOccurs="1" maxOccurs="1"/>
<elementRef key="five" minOccurs="1" maxOccurs="1"/>
<elementRef key="three" minOccurs="2" maxOccurs="2"/>
</bag> What remains to be seen is how well this maps to the RELAX NG |
Hmmm. My Relax NG antennae are a little skittish here. Can’t |
@ebeshero |
Right. Which is to say that So the semantics are different enough that a fully fledged schema language should have both capabilities. And we have tried to provide them with We do not actually use the “one of each of my children” semantics in the Guidelines at all. (In large part because XML DTDs don’t have this concept. (SGML DTDs did.)) But we should provide the capability to ODD writers. (We thought it was necessary when we added |
Thanks for explaining the distinction! I was thinking of I like the flexibility and constraint of this |
I am cautiously positive about the proposal to introduce
satisfied by both of the following, or by only the first?
|
@lb42 I would say both are OK. My convoluted logic is that if you specify minOccurs = "0" on something, then you can have the absence of that element anywhere in the container. :-) So if you have two of something, either can be anywhere. @sydb, @joeytakeda? |
Arguing from the case where absence is permissible anywhere doesn't really persuade me. Absence is not the same as presence: for one thing, two absences are not distinguishable from one! |
Thank you for that research, @lb42. We don’t have to accept that definition, of course. We could decide that a new “one of each” element that has a child with However, the obvious representation of our new toy in RELAX NG is <bag>
<elementRef key="one" minOccurs="1" maxOccurs="1"/>
<elementRef key="two" minOccurs="1" maxOccurs="2"/>
</bag> would be |
This reminds me that another possible name for this new element might be |
Commenting to bump this back to people's attention, and also because: I've been looking into this a bit, and I'm not sure "bag" is a safe name for what's going on. RelaxNG "Bag" (to my mind) implies "one or more of each child pattern in any order," which is not what RNG interleave does. It means (I think) "one of each child pattern, in any order, and patterns may not overlap". "Set" might be ok, though perhaps it risks causing confusion. Or, as @lb42 suggests, just use "interleave". One other wrinkle that occurs to me: checking the validity of the content of this thing, whatever we call it, will entail expanding references, since you have to ensure there's no overlap. |
After some discussion on the TEI list (introduced by Daniel Schopper here: https://listserv.brown.edu/cgi-bin/wa?A2=ind2303&L=TEI-L&P=741 and continuing) we're liking idea of introducing |
Since this isn't likely to be completed in time for the next release, as a band aid I'm going to fix the description on
|
Council decides on 2023-05-08 F2f that we should:
|
sequence/@preserveOrder
is misleadingsequence/@preserveOrder
is misleading
sequence/@preserveOrder
is misleading
Created stylesheet issue for converting tei:interleave to rng:interleave: [(https://github.com/TEIC/Stylesheets/issues/609)]. |
* New elementSpec and updated TD * Still (possibly) need to address hcayless' point about validity of the construct (i.e. no overlap)
To summarize work so far:
I haven't yet addressed @hcayless 's point about validation though. My inclination is that this is a job for the ODD processor (though we could add some schematron now to catch simple cases), but we should probably take a look at the RelaxNG spec for some guidance as to what we can catch early on. |
Currently
@preserveOrder
on<sequence>
is an optional attribute and the spec states: "if true, indicates that the order in which component elements of a sequence appear in a document must correspond to the order in which they are given in the content model." However, the default behaviour for<sequence>
is that order is preserved unless@preserveOrder
is false, but the current description makes it seem that the opposite is true (i.e. that order doesn't matter by default); plus, setting tofalse
hasn't worked since at least 2017 per TEIC/Stylesheets#241.Since
@preserveOrder
is implicitly true, I think that it should gain a default value of true so that it states explicitly what's already happening; I would also suggest that the description be changed to reflect that "true" is default and also outline what happens when its value is "false".The text was updated successfully, but these errors were encountered: