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"
            substitutionGroup="_LargeGroup"/>

<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
like:

                        _LargeGroup
                        /    |  \  \
                _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.
                 
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 14 October 2003 07:24:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:40 GMT