- From: Eric van der Vlist <vdv@dyomedea.com>
- Date: Fri, 16 Nov 2001 11:53:24 +0100
- To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
- Cc: xmlschema-dev@w3.org
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: 6.1.1 It must have exactly one such group. 6.1.2 The ·actual value· of both that group's minOccurs and maxOccurs [attribute] must be 1 (or ·absent·)." 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... 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. 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: <xs:group name="group"> <xs:sequence> <xs:element name="foo" type="xs:token"/> <xs:element name="bar" type="xs:token"/> <xs:group ref="group" minOccurs="0"/> </xs:sequence> </xs:group> Eric > > ht > -- Rendez-vous ą Paris pour le Forum XML. http://www.technoforum.fr/Pages/forumXML01/index.html ------------------------------------------------------------------------ Eric van der Vlist http://xmlfr.org http://dyomedea.com http://xsltunit.org http://4xt.org http://examplotron.org ------------------------------------------------------------------------
Received on Friday, 16 November 2001 05:53:30 UTC