-
Notifications
You must be signed in to change notification settings - Fork 84
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
Deprecation of classSpec/@generate
and classRef/@expand
with alternative solutions.
#2549
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.) |
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):
Because that validates exactly the same set of documents as
the ODDism <interleave minOccurs="1" maxOccurs="unbounded">
<classRef key="model.firstThree" org="group"/>
<classRef key="model.lastThree" org="group"/>
</interleave> is exactly the same as the example. That is, inside in 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:
|
This PR is work in progress to address issue #2369
@generate
on<classSpec>
and implement a 6-month deprecation period.@expand
on<classRef>
in the 4 instances where it is mentioned in the Guidelines with<elementRef>
s@expand
on<classRef>
for 6 months, and make<classRef>
a child of<alternate>
instead (and potentially<interleave>
once added. See Addinterleave
element (and deprecatesequence/@preserveOrder
) #2538.