[Standards-JIG] sequence vs. choice in Jabber/XMPP schemas
dwaite at gmail.com
Wed Aug 17 05:15:28 UTC 2005
On 8/16/05, Trejkaz <trejkaz at trypticon.org> wrote:
> Quoting David Waite <dwaite at gmail.com>:
> > No. Schema validity might be a matter of conformance, but there aren't
> > very many options for a client or server to respond to invalid xml, no
> > matter if it is a strict or loose schema. So, I'd prefer just a strict
> > schema to model what I 'should' send, because I can't use the loose
> > schema to really do anything.
> A loose/strict scheme would work like this:
> * Implementations MUST conform to the loose schema.
> * Implementations SHOULD conform to the tight schema.
> In other words, you can use the loose schema to determine what other
> implementations might send to you, so that you can prepare for it.
How would you prepare for that different than the random xml they
might send you?
> But here's another question: Why do we have an ordering in the first place?
> Is there actually a semantic difference between <username/><password/> and
> <password/><username/>, or was it just done solely to make the schema harder
> to conform to? (Anyone using an automatic XML data binding would have had
> no trouble, but anyone using DOM would be in for a small nightmare.)
> As far as I can tell, we really do mean <xs:all> in almost all cases.
<xs:all> is very limited in terms of what you can do with it. For
example, you cannot use xs:all if you want to allow more than one
child element with a particular name.
More information about the Standards