[Standards-JIG] sequence vs. choice in Jabber/XMPP schemas
Peter Saint-Andre
stpeter at jabber.org
Mon Aug 15 17:38:53 CDT 2005
Traditionally, old-style Jabber implementations did not care about the
order of elements. When we began to define XML schemas rather than DTDs
for JEPs and (later) the XMPP RFCs, we used xs:sequence (prioritizing
more careful specification of the number of allowable child elements)
rather than xs:choice (which would have prioritized allowing any order
of child elements). Even though the existing schemas are described as
informative rather than normative, people have used them for
compliance-testing purposes. The predictable result is that existing
implementations have failed the compliance tests. I see several possible
approaches to remediation:
1. Keep using xs:sequence and require existing implementations to pay
attention to the order of child elements.
2. Switch to xs:choice and care less about the number of allowable child
elements.
3. Define two different sets of schemas: a strict one following (1) and
a loose one following (2).
4. Switch from W3C XML Schema to a different schema language, such as
RELAX NG, Schematron, or Examplotron.
Thoughts?
</psa>
--
Peter Saint-Andre
Jabber Software Foundation
http://www.jabber.org/people/stpeter.shtml
More information about the Standards-JIG
mailing list