-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Using xs:all instead of xs:sequence improves the error messages of the PVCollada XML doc validator. xs:sequence and xs:all allow us to define XMLSchema element definitions with multiple fields, but they differ by how many times a field is allowed to appear and what order fields can appear in:
xs:sequence:- Using
minOccursandmaxOccurs, fields can appear at least zero times. - The order of an element's fields in an XML document must match the order they appear in the XML schema's element definition.
- Using
xs:all:- Fields can only appear at most once.
- The order of an element's fields is not enforced.
Here is their XMLSchema specification.
Element definitions that do not represent arrays of elements should use xs:all instead of xs:sequence. For example, the project element has fields that appear at most once (i.e., none of them have the attribute maxOccurs="unbounded"), so project can use xs:all. Making this change improves the error messages of the validator. When defining project with xs:sequence, the validator only reports the next missing field; however, when defining project with xs:all, the validator reports all the missing fields.
On the other hand, here is an observation that suggests xs:all should not be used -- xs:all is never used by the COLLADA schema.