I have run into a deal-stopper in constructing a schema for RSS 2.0. Meaning
that there is structure in the RSS spec that can't be modeled in schema
notation.
The problem is, in an element list where order is not important (the <channel>
element), it's only permitted for each child element to occur 0 or 1 times, no
more. This isn't the case when there is more than one <category>.
A simple example:
<root>
<a/>
<b/>
<b/>
<!-- Any number of b's here or anywhere under root. -->
<c/>
</root>
<root>
<b/> <!-- Or no b here at all -->
<a/>
<c/>
</root>
As far as I can tell, these two structures can't be validated with a single W3C
schema.
I've been researching this and trying examples and ideas for most of today. Also
talking to people I know who work with XML and validation. And it seems that
this 0-or-1 restriction on unordered elements is real.
As far as I'm concerned, this wraps it up for the usefulness of schema
validation for this format. It shouldn't be the place of the schema language to
dictate a change to an existing, well-formed file format that's in widespread
use. I don't have the authority to ask for a change like that and certainly the
designers of schema don't have that authority.