- From: Matt Timmermans <mtimmerm@opentext.com>
- Date: Mon, 16 Oct 2000 15:07:44 -0400
- To: "'C. M. Sperberg-McQueen'" <cmsmcq@acm.org>, "'Martin J. Duerst'" <duerst@w3.org>
- Cc: "'Martin Gudgin'" <marting@develop.com>, "'Schema Comments'" <www-xml-schema-comments@w3.org>, "'Dan Rupe'" <Dan_Rupe@go.com>
> -----Original Message----- > From: www-xml-schema-comments-request@w3.org > >>Could > >>you give a concrete use case for allowing an arbitrary sequence of > >>a, b, c, and d elements where (a) the sequence of the elements is > >>significant, > > > >Did you want to write 'insignificant'? That's what both the current > >all groups and my proposal are about. > > I think not. If the sequence of child elements has no significance, > and they are not all optional, then the order of children might as > well be (and usually should be) fixed. Here is my list of use cases for all with occurs > 1: CASE 1 ====== Many specification languages have an unordered different kinds of declarations to be interleaved in any order, but have one or more distinguished types of declarations that can occur only once. Usually this happens when: a) The entire file represents the flattening of some heirarchy or DAG of relationships. The "distinguished" delcaration would typically correspond to the root; and b) The XML containment heirarchy is used to express a _different_ relationship. Consider Java source files, which should contain at most one public class, and C source files, which can contain at most one main function. It's a reasonably common pattern. And the order of the declarations often _is_ significant. In a rough descending order of significantness: i) It is reasonably common to restrict declarations to refer only to previous (not following) declarations. This is common, for example, when you're flattening a DAG of relationships, and you want to enable streaming processing. It's also very common in programming languages. In general, the position of a declaration in the source file contributes to the context in which the declaration is interpreted. ii) The order is not semantically significant, but affects the efficiency of processing. If a declaration is referred to in 100 places, for example, it will often be more efficient to put it first, allowing the system to remember just that first declaration, instead of the 100 referencing declarations. iii) The order is not semantically significant, but affects readability. (Rick Jelliffe's argument) This is important for long specifications. How come XML schema doesn't force complex type decls to come before element decls? CASE 2 ====== I will assume that all groups with all maxOccurs <= 1 are useful in at least some situations, simply because we include them in Schema (I was never convinced that they were, actually -- I subscribe to your view above). I know that openness-by-wildcard is useful in several situations. As far as I can tell rationale for using each of these features is orthogonal to rationale for using the other, so there should (statistically) be situations in which these features are useful simultaneously. Openness-by-wildcard requires repetition, however, and so it is currently impossible to use it within all groups. The way to open an all group would be (a & b & c & whatever*), using interleave semantics, which corresponds exactly to Martin's desires.
Received on Monday, 16 October 2000 15:08:27 UTC