-
Notifications
You must be signed in to change notification settings - Fork 96
Deprecation of classSpec/@generate and classRef/@expand with alternative solutions.
#2549
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
base: dev
Are you sure you want to change the base?
Conversation
|
Sorry, I am still not convinced that having We are talking about references to classes that are currently expandable into one of:
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" ( I don’t think there is any way to represent those 4 possibilities just by noticing that the parent of <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 So I think I have now convinced myself that being a child of |
|
Would it suffice to add an attribute to |
|
We could add an attribute to classRef:
|
|
F2F in BA: Action on SB, JT, and RV to meet post-F2F to formalize a proposal, taking into account also #2538 |
|
Subgroup @sydb , @joeytakeda , @raffazizzi suggest using Introduce a new attribute potentially called (Defaults in bold.) EDIT: F2F in Kraków decides "membersOccur" should be "cardinality" with values "one", "oneOrMore", "zeroOrOne", "zeroOrMore" |
|
Examples to clarify @raffazizzi’s summary, above … Imagine that we have 3 classes, model.firstThree, model.midThree, and model.lastThree. The members of model.firstThree are We are suggesting the following. (Note that we did not discuss the pattern names at all, but they are essentially arbitrary, as they only occur in the RELAXNG schema, the user never sees them. So the names should be chosen to make debugging easier.) class definitionsEach class gets expanded to 8 spearate patterns in the RELAX NG output. Here is what model.firstThree would look like in the compact syntax. (Remember that we are planning to get rid of (For the masochists among you who prefer to see this in the XML syntax you can find it near the bottom of this comment.) The same sort of 8 separate definitions holds for model.midThree (with "m", "n", & "ñ"), model.lastThree (with "x", "y", & "z"), and model.randFour (with "a", "d", "n", & "r"). If you want to play around with a schema that has these classes already defined, you are in luck. I have created a shell of a schema for that very purpose. Note the ".txt" extension (which is there just so gitHub will let me put it here) should probably be removed. example oneEither of these: <classRef key="model.firstThree"/>
<classRef key="model.firstThree" org="group" membersOccur="single"/>would resolve to <rng:ref name="model.firstThree_singles_interleaved"/>example two<classRef key="model.midThree" org="choice" membersOccur="single"/>would resolve to <rng:ref name="model.midThree_singles_alternated"/>example three<classRef key="model.lastThree" org="choice" membersOccur="optional"/>would resolve to <rng:ref name="model.lastThree_optionals_alternated"/>example four<classRef key="model.firstThree" org="group" membersOccur="repeatable" minOccurs="2" maxOccurs="3"/>would resolve to <rng:group>
<rng:ref name="model.firstThree_repeatable_interleaved"/>
<rng:ref name="model.firstThree_repeatable_interleaved"/>
<rng:optional>
<rng:ref name="model.firstThree_repeatable_interleaved"/>
</rng:optional>
</rng:group>example five<alternate>
<classRef key="model.firstThree" org="group" membersOccur="optionalRepeatable"/>
<classRef key="model.midThree" org="group" membersOccur="optionalRepeatable"/>
<classRef key="model.lastThree" org="group" membersOccur="optionalRepeatable"/>
</alternate>would resolve to <rng:choice>
<rng:ref name="model.firstThree_optionalRepeatable_interleaved"/>
<rng:ref name="model.midThree_optionalRepeatable_interleaved"/>
<rng:ref name="model.lastThree_optionalRepeatable_interleaved"/>
</rng:choice>which itself has the same effect as the following (in the compact syntax): That is, So <a/><a/><b/><b/><b/>would be valid, but <a/><y/>would not be valid. example six<interleave>
<classRef key="model.firstThree" org="choice" membersOccur="repeatable"/>
<classRef key="model.midThree" org="choice" membersOccur="repeatable"/>
<classRef key="model.lastThree" org="choice" membersOccur="repeatable"/>
</interleave>would resolve to <rng:interleave>
<rng:ref name="model.firstThree_repeatable_alternated"/>
<rng:ref name="model.midThree_repeatable_alternated"/>
<rng:ref name="model.lastThree_repeatable_alternated"/>
</rng:interleave>which itself has the same effect as the following (in the compact syntax): That is a weird content model that forces the user to pick one element from each “set” (e.g., So <a/><n/><z/><z/><n/><a/>would be valid, but <a/><n/><z/><z/><n/><c/>would not be valid (because it has both an example seven<interleave minOccurs="1" maxOccurs="unbounded">
<classRef key="model.firstThree"/>
<classRef key="model.lastThree"/>
</interleave>would resolve to <rng:oneOrMore>
<rng:interleave>
<rng:ref name="model.firstThree_singles_alternated"/>
<rng:ref name="model.lastThree_singles_alternated"/>
</rng:interleave>
</rng:oneOrMore>which itself has the same effect as the following (in the compact syntax): example eightThis example is just like example six but uses model.randFour instead of model.lastThree, which results in an INVALID RELAX NG schema. <interleave>
<classRef key="model.firstThree" org="choice" membersOccur="repeatable"/>
<classRef key="model.midThree" org="choice" membersOccur="repeatable"/>
<classRef key="model.randFour" org="choice" membersOccur="repeatable"/>
</interleave>would resolve to <rng:interleave>
<rng:ref name="model.firstThree_repeatable_alternated"/>
<rng:ref name="model.midThree_repeatable_alternated"/>
<rng:ref name="model.randFour_repeatable_alternated"/>
</rng:interleave>which itself has the same effect as the following (in the XML syntax with line numbers added): 01) <rng:interleave>
02) <rng:choice>
03) <rng:oneOrMore>
04) <rng:ref name="a"/>
05) </rng:oneOrMore>
06) <rng:oneOrMore>
07) <rng:ref name="b"/>
08) </rng:oneOrMore>
09) <rng:oneOrMore>
10) <rng:ref name="c"/>
11) </rng:oneOrMore>
12) </rng:choice>
13) <rng:choice>
14) <rng:oneOrMore>
15) <rng:ref name="m"/>
16) </rng:oneOrMore>
17) <rng:oneOrMore>
18) <rng:ref name="n"/>
19) </rng:oneOrMore>
20) <rng:oneOrMore>
21) <rng:ref name="ñ"/>
22) </rng:oneOrMore>
23) </rng:choice>
24) <rng:choice>
25) <rng:oneOrMore>
26) <rng:ref name="r"/>
27) </rng:oneOrMore>
28) <rng:oneOrMore>
29) <rng:ref name="a"/>
30) </rng:oneOrMore>
31) <rng:oneOrMore>
32) <rng:ref name="n"/>
33) </rng:oneOrMore>
34) <rng:oneOrMore>
35) <rng:ref name="d"/>
36) </rng:oneOrMore>
37) </rng:choice>
38) </rng:interleave>which is illegal both because
To my surprise, In any case, Stylesheets issue #719 is for figuring out what to do with invalid RELAX NG. bonus:
|
of a class reference of "sequence" just list the element references in the right order. This is being done in preparation for removing the expand= attribute.
of a class reference of "sequenceOptional" just list the element references in the right order with a minOccurs= of 0. This is being done in preparation for removing the expand= attribute.
in the specifications of msIdentifier and altIdentifier with just a list the element references in the right order with a minOccurs= of 0. This is being done in preparation for removing the expand= attribute.
element that we probably will not use — it has require= instead of org=.
classRef element with org= (and membersOccur=) attributes
use of org= and membersOccur= to when the class reference is in a content model.
schema & tagdoc portion of attr changes to classRef. (Still need to work on the prose.) Not thoroughly tested. Note that we are not all that happy with this setup — we would have preffered to have a generic version of att.organizable, and have both attList and classRef over- ride the value list and defaut values (and maybe other things, too), but found that the Stylesheets don’t seem to support that: if all elements that are member of the class override the attribute def, the class was getting dropped.
of them v. important (an extraneous “not” :-)
the memberOf element, as they make no sense except when used in a sequence reference, which has been deprecated
This PR is work in progress to address issue #2369
@generateon<classSpec>and implement a 6-month deprecation period.@expandon<classRef>in the 4 instances where it is mentioned in the Guidelines with<elementRef>s — done in commits 5a9b95e, 957c76a, and 98a1b95; note that some significant changes were made, e.g. deleting classes (that we had wanted for some reason)@expandon<classRef>for 6 months — oops; valid until date set to 2027-03-02 at the same time above was done@minand@maxon<memberOf>for exactly the same period. (Class members must be in alternation, be in a sequence, or be interleaved. Having a member of a class occur in that class more than once does nothing if the class is in alternation, makes sense if the class is a sequence, and is not allowed if the class members are interleaved. We no longer allow class members to be in a sequence, so these attrs have no use.)@org(moved into a class from<attList>) — What should class be named? Lots of work should be done on glosses & descriptions before we copy@orgfrom<attList>to a class (used by<attList>and<classRef>). — tagdoc portion done; still work to do on prose, and could perhaps use an example or two@cardinalityattribute (see Deprecation ofclassSpec/@generateandclassRef/@expandwith alternative solutions. #2549 (comment)) — tagdoc portion done; still work to do on prose, and could perhaps use an example or twoclassSpec/@generateandclassRef/@expandwith alternative solutions. #2549 (comment)<classRef>is a child of the forthcoming<interleave>element. See Addinterleaveelement (and deprecatesequence/@preserveOrder) #2538