- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Mon, 12 Nov 2001 17:12:14 +0000
- To: "K.Mroczek" <kmroczek@altkom.com.pl>
- CC: xmlschema-dev@w3.org
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.
For example if the base definition of group foo is:
<xs:group name="foo">
<xs:sequence>
<xs:element ref="A" minOccurs="0" />
<xs:element ref="B" minOccurs="0" />
</xs:sequence>
</xs:group>
Then you could have a restricting redefinition that restricted the
sequence so that it *must* contain a B element with:
<xs:redefine schemaLocation="...">
<xs:group name="foo">
<xs:sequence>
<xs:element ref="B" />
</xs:sequence>
</xs:group>
</xs:redefine>
And you could have an extending redefinition adding a C element with:
<xs:redefine schemaLocation="...">
<xs:group name="foo">
<xs:sequence>
<xs:group ref="foo" />
<xs:element ref="C" minOccurs="0" />
</xs:sequence>
</xs:group>
</xs:redefine>
By my reading of the Rec the 'extension' of groups by redefinition are
a lot less constrained than the extension of complex types. For
example, you could equally have:
<xs:redefine schemaLocation="...">
<xs:group name="foo">
<xs:sequence>
<xs:element ref="C" minOccurs="0" />
<xs:group ref="foo" />
</xs:sequence>
</xs:group>
</xs:redefine>
Or:
<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>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
Received on Monday, 12 November 2001 12:12:24 UTC