[standards-jig] sequence vs. choice
stpeter at jabber.org
Wed Feb 6 23:37:47 UTC 2002
On Wed, 6 Feb 2002, David Waite wrote:
> Hmm, if this is informational, we shouldn't go changing things now by
> saying that elements have to occur in a particular order :-)
Hey, I was just wondering. :) The current DTDs don't even include the
error element, so I'm just cleaning things up.
> 1. elements within message/presence/iq can happen in any order
> 2. there may be rules about how many body/subject/etc tags you can have
Are there now? AFAIK, you can have only one of each of these.
> 3. there may be rules about XML contained within a body/subject/etc tag
> (only CDATA, no mixed data)
BUT you can have as many additional elements (e.g., <x/>) as you want,
right? So I go back to this question:
> >XML schemas question: can do the following to override the maxOccurs on
> >the <xsd:choice/> element?
> > <xsd:choice minOccurs='0' maxOccurs='1'>
> > <xsd:element ref='body' />
> > <xsd:element ref='subject' />
> > <xsd:element ref='thread' />
> > <xsd:any namespace='##any' minOccurs='0' maxOccurs='unbounded' />
> > <xsd:element ref='error' />
> > </xsd:choice>
Maybe I just put in minOccurs and maxOccurs for each element, eh?
More information about the Standards