Re: Group redefinition and recursive content models.

Eric van der Vlist <vdv@dyomedea.com> writes:

> Henry S. Thompson wrote:
> 
> > Eric van der Vlist <vdv@dyomedea.com> writes:
> >
> 
> >>Just wondering how a recursive group such as:
> >>
> >>  <xs:group name="group">
> >>   <xs:sequence>
> >>     <xs:element name="foo">
> >>      <xs:complexType>
> >>        <xs:group ref="group" minOccurs="0"/>
> >>      </xs:complexType>
> >>     </xs:element>
> >>     <xs:element name="bar" type="xs:token"/>
> >>   </xs:sequence>
> >>  </xs:group>
> >>
> >>may be redefine without confusion between the <xs:group ref="group"/> meaning
> >>"extension", the <xs:group ref="group" minOccurs="0"/> meaning "bogus
> >>extension" the <xs:group ref="group" minOccurs="0"/> meaning "reference" ???
> >>
> > I don't see the problem here.  In the _redefinition_, the details of
> > the original definition are irrelevant, and it's the redefinition with
> > respect which the constraints are expressed.
> 
> 
> Then probably I don't read "among its contents at some level" correctly in:
> 
> "6.1 If it has a <group> among its contents at some level the ·actual value·
> of whose ref [attribute] is the same as the ·actual value· of its own name
> attribute plus target namespace, then all of the following must be true:

The referent of 'it' and 'its' in "it has a <group> among its
contents" is the <group> EII which is a child of <redefine>, i.e. the
XML representation of the redefining form.  We haven't gotten to
components, or discharging references, yet.


> If I want to restrict this type to add a constraint on the type of element
> "bar", I will write:

> <xs:redefine schemaLocation="whatever.xsd">
>    <xs:group name="group">
>     <xs:sequence>
>      <xs:element name="foo">
>       <xs:complexType>
>        <xs:group ref="group" minOccurs="0"/>
>       </xs:complexType>
>      </xs:element>
>     <xs:element name="bar" type="xs:NMTOKEN"/>
>    </xs:sequence>
>   </xs:group>
> </xs:redefine>
> 
> It the <xs:group ref="group" minOccurs="0"/> is "among its contents at some
> level" then there is a confusion betwee, a bogus extension and a restriction...

Ah, _now_ I understand -- you're not trying to redefine by extending
that group, you're trying to redefine by restricting it, but the form
about is ambiguous wrt that goal.

>  From your answer, I realize that the rec might mean "among its contents at
> some level but still with a parent equal to the current element" or something
> like that.

Well, you've clarified that it _should_ mean that, thank you!

> If it's the case, I wonder if "direct" recursive group definitions might be
> useful in some cases and if they are clearly forbiden. If they were allowed,
> this definition could not be redefined

<snip/>

But 'direct' circular groups, even with min=0, are in fact disallowed [1].
So at least _this_ problem doesn't arise.

ht

[1] http://www.w3.org/TR/xmlschema-1/#mg-props-correct
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Friday, 16 November 2001 06:29:36 UTC