Re: Nested Substitutiongroups, how to?

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 UTC