Re: How to redefine <group> and <attributeGroup>?

Jeni Tennison wrote:

> Hi Krzysztof,
> 
> 
>>What is the meaning (and syntax) of redefinitions <group> and
>><attributeGroup>? Clauses 6.2 and 7.2 in "Schema Representation
>>Constraint: Redefinition Constraints and Semantics" (4.2.2
>>structures) look like a method for redefinition by 'restriction'.
>>But what is the interpretation of clauses 6.1 and 7.1? Is it
>>describe a method for redefinition by 'extension'?
>>
> 
> Yes, 6.1 and 7.1 specify ways in which you can redefine groups and
> attributeGroups by adding new particles/attributes to them (extending
> them), and 6.2/7.2 are ways of redefining groups and attributeGroups
> by restricting them.


The text is very short and concise, for instance for groups:

6 Within the [children], for each <group> the appropriate case among the 
following must be true:
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·).
6.2 If it has no such self-reference, then all of the following must be 
true:
6.2.1 The ·actual value· of its own name attribute plus target namespace 
must successfully ·resolve· to a model group definition in I.
6.2.2 The {model group} of the model group definition which corresponds 
to it per XML Representation of Model Group Definition Schema Components 
(§3.7.2) must be a ·valid restriction· of the {model group} of that 
model group definition in I, as defined in Particle Valid (Restriction) 
(§3.9.6).


I wonder it it's sufficient to describe group extension. For instance:

<xs:redefine schemaLocation="bar.xsd">
  <xs:group name="foo">
    <xs:sequence>
     <xs:group ref="foo" minOccurs="0"/>
     <xs:element ref="bar"/>
    </xs:sequence>
  </xs:group>
</xs:redefine>

is forbidden, but what about:

<xs:redefine schemaLocation="bar.xsd">
  <xs:group name="foo">
    <xs:sequence>
      <xs:sequence minOccurs="0">
        <xs:group ref="foo"/>
       </xs:sequence>
     <xs:element ref="bar"/>
    </xs:sequence>
  </xs:group>
</xs:redefine>

which is equivalent?

And even your:


> <xs:redefine schemaLocation="...">
> 
> <xs:group name="foo">
>   <xs:choice>
>     <xs:element ref="C" minOccurs="0" />
>     <xs:group ref="foo" />
>   </xs:choice>
> </xs:group>
> 
> </xs:redefine>


has the effect to allow a content where none of the content of "foo" is 
mandatory which seems contrary to (what I have understood of) the 
philosophy of the redefinition which is to avoid that the applications 
are "too much surprised" by the redefinition.

Cheers,

Eric
-- 
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 Tuesday, 13 November 2001 12:35:21 UTC