Re: LC-222 revamping occurrence indicators

At 2000-10-06 01:45, C. M. Sperberg-McQueen wrote:
 > Dear Paul: ...
 >
 > Among other issues, the XML Query WG raised the point registered as
 > issue LC-222, which suggests that the repetition information
 > represented variously in DTDs by star, plus, question mark, and the
 > absence of any occurrence indicator be represented, both in the XML
 > Schema transfer syntax and on the abstract schema-component level, by
 > separate constructs (separate elements in the transfer syntax,
 > presumably separate components on the abstract level), instead of
 > being expressed by attributes of other elements or properties of other
 > components.
 >
 > As I reported to the Query WG at the face to face meeting in Hawthorne
 > last month, there was no consensus in the WG in favor of making this
 > change.  Some WG members felt it would be an improvement to the
 > transfer syntax (though probably not to the abstract component level);
 > others felt it would be detrimental to the transfer syntax.  All felt
 > that it would delay the spec; even some of those who felt the change
 > would be an improvement felt the improvement was too minor to be worth
 > incurring the editorial and other costs.

My apologies to the XML Query WG.  I have discovered that my earlier
account of the issue is misleading in that it omits a salient point:
the proposal you make has in fact been implemented on the abstract
component level.

The transfer syntax is as described: repetition of an element or group
in a content model is specified with attributes on the <element> or
(say) <sequence> element.  A content model which requires one
occurrence of element A and two of element B, for example, might be
written:

   <complexType>
     <sequence>
       <element name="A" minOccurs="1" maxOccurs="1"/>
       <element name="B" minOccurs="2" maxOccurs="2"/>
     </sequence>
   </complexType>

[N.B. I have not attempted to validate this, so beware of typos]

At the abstract component level, however, the occurrence information
is already factored out, in the manner suggested by your comment.  For
the content model above, there would be several components:

   (1) a complex type definition component (unnamed), with {content
   type} equal to a pair consisting of a content model (a particle
   component) and the keyword "element-only"

   (2) a particle component for the content model, with {min occurs} =
   1, {max occurs} = 1 and {term} equal to item (3) in this list

   (3) a model group component with {compositor} = 'sequence' and
   {particles} equal to the sequence of items (4) and (6) in this list

   (4) a particle component with {min occurs} = {max occurs} = 1 and
   {term} = item (5) in this list

   (5) an element declaration component with {name} = "A"

   (6) a particle component with {min occurs} = {max occurs} = 2 and
   {term} = item (7) in this list

   (7) an element declaration component with {name} = "B"

I would give an illustration in Lisp syntax but it's getting late.  A
simple XML representation (I am improvising this, and not showing all
properties) might be

   <complexTypeDefinition id="c1"
     content-model="p1"
     content-type-keyword="element-only" />
   <particle id="p1"
     minOccurs="1"
     maxOccurs="1"
     term="g1" />
   <group id="g1"
     compositor="sequence"
     particles="p2 p3"/>
   <particle id="p2"
     minOccurs="1"
     maxOccurs="1"
     term="e1" />
   <particle id="p3"
     minOccurs="2"
     maxOccurs="2"
     term="e2" />
   <element id="e1"
     name="A"/>
   <element id="e2"
     name="B"/>

So I was quite wrong in suggesting that your proposal had simply been
rejected.  We might say that on the abstract component level the
proposal was so thoroughly approved that it had already been adopted
before your comment was received.  The 'particle' component described
in the structures spec section 2.2.3.2 has no function except to carry
repetition information and occupy the space immediately 'above' the
item whose repetition is being described.

The name 'particle component' is chosen, I believe, to convey (as it
does) that this component and its descendents represent a single
'content model particle' (in the terminology of the XML 1.0 spec).  I
confess that the name does not immediately suggest to the mind the
role of this component in separating information about repetitions
from information about the item(s) repeated; this fact may perhaps be
made responsible for the fact that you, in making your comment, and I
in responding to it, alike overlooked the fact that what you described
as desirable is already the state of affairs.

I am gratified to learn and report that we are in better agreement
than either WG earlier believed.

-Michael Sperberg-McQueen
  Co-chair, XML Schema WG

Received on Wednesday, 18 October 2000 00:54:01 UTC