-
Notifications
You must be signed in to change notification settings - Fork 87
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
Need to clarify the relationship between classSpec/@generate
and classRef/@expand
#2369
Comments
@lb42 What do you remember about this? What was the imagined use-case for |
The motivation for classSpec/@generate is partly, even mainly, the avoidance of magic. Given the need to have classSpec generate multiple patterns/entitiy declarations, it seemed necessary to document and hence potentially t leqst limit what those multiple things should be. You cant, of course, put a class as such into a content model, so we needed to make clear how a classRef should be mapped: hence the meed for @expand. What does it mean if @expand tries to produce something not allowed for by @generate? it might trigger a warning i suppose, but it would presumably produce a partial or invalid content model. Has anyone ever used @generate with a non-default value? I doubt it very much! But it's a good thing to keep developers honest by requiring that arbitrary decisions like how a classReference in a content model can potentially be interpreted be explicitly documented I think. |
Unless, of course, you want to say that once a class is defined, it can be referenced however the referrer wants. As it is, the definer of the class gets to limit how it might be referred to. But as we all seem to agree, that is a very rarely used feature. |
Cf. Stylesheets #582. I am almost convinced that we should just drop |
For completeness: If @generate is kept we need to discuss its relation to the model class hierarchy. |
@joeytakeda found this example of |
After looking at this, I find I don't understand |
I asked sebastian the same question, many years ago. |
I'm quite worried by this. The whole thing seems to assume that classes behave like partial content models, but a class has no idea what order its members are supposed to be in, so how can it be useful to have an |
I'm definitely in favour of getting rid of |
I don't think those two are the same 'sequence'. But it does point up what I think is an error in the documentation. Unless I'm very much mistaken, tei:sequences are (as you would hope and expect) ordered by default. If you set |
Given that there's not a good way to establish a class membership order in the first place, I don't think there's any sense in having mechanisms to exploit membership order. My vote is to deprecate both |
There seems to be a regression wrt TEIC/Stylesheets#241. See https://gist.github.com/dmj/cc0028192edc044d69d5a6b7269657eb -- The @preserveOrder does not have a discernable effect with in Stylesheets version 4.4.0. |
That makes a lot sense—I'm convinced, and thus +1 for deprecating FWIW: As far as I can tell (per a
(Where the first column refers to the specification file in which the classRef is contained and last column are other specifications that have a @dmj :
Testing using the latest Stylesheets in
|
Right! I saw your fix was from July 2022, after the release of 4.4.0 (which ships with oXygen 25). |
Wow, very useful analysis, @joeytakeda, thank you. I have checked all 4 of those class references that use So while I disagree quite strongly with the notion that there is no order, or there is no way to specify the order, I think most of us are at least unhappy with, if not repulsed by, the idea that the order of My current positions (which are not carved in stone) follow.
|
Council F2F Subgroup: We recommend testing to see whether we lose anything important with the removal of |
My somewhat more precise recollection of this morning’s subgroup decision with added details follows.
|
Presumably in the absence of the "sequence" options the recommended way of achieving "a sequence of model.foo elements" would be to define a macro. That means specifying the elements concerned explicitly of course, but if you dont want to use the order of their declaration theres not many options . (There was i vaguely recall a suggesti9n that seqience shouldbe interpreted as "alphabetical order". Nobody liked that much.) |
ATOP group notes for its own future information: If |
VF2F decides to deprecate
|
@sydb has raised a valid concern about allow Returning this ticket to Status: Needs Discussion. |
The
<classSpec>
element has an attribute@generate
which is defined as:The
<classRef>
element has an attribute@expand
which is defined as:Presumably there is some relationship between them, but the documentation is not clear on this. Is it an error to have a
classRef/@expand
which specifies "sequenceOptionalRepeatable" when the<classSpec>
to which it occurs has only@generate="sequenceOptional"
? It would help if the documentation could make this relationship clear, and define what should happen if this scenario is encountered by a processor. Should a Schematron rule be added to constrainclassRef/@expand
based on the value ofclassSpec/@generate
?It would also help to have some explanation of how/why one might use
classSpec/@generate
in the first place. There are no instances of it anywhere in the TEI specs, and none in any of the ODDs we have gathered for the ATOP project. If no-one has ever used it, can we just eliminate it and simplify ODD processing?The text was updated successfully, but these errors were encountered: