W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2003

Re: Nested Substitutiongroups, how to?

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 14 Oct 2003 12:24:39 +0100
Message-ID: <1651461618336.20031014122439@jenitennison.com>
To: "Svend Bent Nielsen" <jawsoap@hotmail.com>
Cc: xmlschema-dev@w3.org

Hi Svend,

> But to have something like LargeGroup, which contains all of
> SmallGroup plus some other elements, how would I do this?

You just say that the <_SmallGroup> element is a member of the
_LargeGroup substitution group:

<xs:element name="_LargeGroup" abstract="true" />

<xs:element name="X" substitutionGroup="_LargeGroup" />
<xs:element name="Y" substitutionGroup="_LargeGroup" />
<xs:element name="Z" substitutionGroup="_LargeGroup" />

<xs:element name="_SmallGroup" abstract="true"

<xs:element name="A" substitutionGroup="_SmallGroup"/>
<xs:element name="B" substitutionGroup="_SmallGroup"/>
<xs:element name="C" substitutionGroup="_SmallGroup"/>
<xs:element name="D" substitutionGroup="_SmallGroup"/>

This gives you an element substitution group hierarchy that looks

                        /    |  \  \
                _SmallGroup  X  Y   Z
                  / |  | \
                 A  B  C  D

so effectively the <A>, <B>, <C>, and <D> elements are part of the
_LargeGroup substitution group as well as being part of the
_SmallGroup substitution group.


Jeni Tennison
Received on Tuesday, 14 October 2003 07:24:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:03 UTC