[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ANN: XML Schema: DOs and DON'Ts
- From: Eddie Robertsson <eddie@allette.com.au>
- To: Martin Gudgin <marting@develop.com>
- Date: Fri, 18 May 2001 10:35:16 +1000
> <xs:all>
> <xs:element name="a" />
> <xs:element name="b" />
> <xs:element name="c" />
> </xs:all>
>
> New type derived by restriction:
> <xs:all>
> <xs:element name="b" />
> <xs:element name="a" />
> </xs:all>
>
> and you are correct, it's *not* a valid restriction because in restriction you
> *must* list the particles in the same order in the derived type as they were
> in the base type. Reversing the order of the element decls for a and b in this
> case is what causes the problem.
Sorry, I didn't even realise that the order in the restricted type was different
from the order of the elements in the base type. I guess I just proved Kohsuke's
point that it can be dangerous if the validator doesn't conform to the spec. But
then again isn't that the whole point of an XML Schema validator?
However, I take your point that in avoiding these "extreme validation issues"
you can make do with a non-fully conformant XML Schema validator.
On a side issue: Why does this constaint on restriction apply to <xsd:all> and
<xsd:choice> groups? It's logical for <xsd:sequence> since the sequence is
important but in <xsd:choice> and <xsd:all> the order is insignificant.
Cheers,
/Eddie