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

Re: Nested Substitutiongroups, how to?

From: Svend Bent Nielsen <jawsoap@hotmail.com>
Date: Tue, 14 Oct 2003 16:47:52 +0000
To: xmlschema-dev@w3.org
Message-ID: <BAY7-F90dPJlsYcnpUl000103ef@hotmail.com>

Hi again all,

I am not sure that I understand this substitutiongroup thing. I still have 
problems with it.

I have an element "Section" which can contain other "Section" as well as 
"Comment".
     Section
      |       \
Comment   Section
                  |       \
             Section   Comment

That is, Comment is a leaf node and can not ever contain other than text 
(simpletype).

How would I make a substitutionGroup that explains this?
Or is the below method the right way of doing this?

<xs:element name="Section">
  <xs:complextype>
    <xs:choice>
      <xs:element ref="Section" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="Comment" type="xs:string" minOccurs="0" 
maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complextype>
</xs:element>

What if "Section" can also contain "_SmallGroup" (from earlier)? How can I 
write that?

Sincerely,
Svend Bent Nielsen

NB: Something went wrong with my spamfilter, so I have only been receiving 
mails from this list for the past 15 minuttes, except for mails that where 
directed at me (which helped me define the problem and thus the solution, 
thanks).

_________________________________________________________________
Få alle de nye og sjove ikoner med MSN Messenger http://messenger.msn.dk/
Received on Tuesday, 14 October 2003 12:47:53 GMT

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