[xsd-users] Error on code generation in c++ from statechart
schema "scxml.xsd"
Boris Kolpackov
boris at codesynthesis.com
Fri Nov 11 05:22:40 EST 2011
Hi Anton,
agarriga at free.fr <agarriga at free.fr> writes:
> and I don't understand why from files written and validated by the W3C i
> have the following error with xsd.exe ?
Some of the worst schemas that we have seen are from W3C.
> I understand "violates the unique particle attribution rule" but i don't
> know from where the error comes:
>
> - a bug in xsd.exe ?
> - or in scxml.xsd files from W3C ?
This depends on the interpretation of the unique particle attribution
rule from the XML Schema specification. In the scxml schema there are
unbounded sequences of unbounded sequences of the xsd:any wildcards
(see the scxml.extra.content group and how it is used). In the strict
interpretation of the rule, this is a violation, since there are
multiple ways to associate elements to this sequence-of-sequences
content model. However, some processors may be able to "see" that this
is really just a single sequence and not flag it as an error. The way
to "fix" this schema would be to remove the minOccurs="0",
maxOccurs="unbounded" from the references to the scxml.extra.content
group.
Though this will still be in vain since the scxml schemas use the
xsd:redefine construct which is not supported by XSD (Just to
confirm my point about W3C-designed schemas, it is widely agreed
that the xsd:redefine is a mis-feature, should not be used, and
will be deprecated in the next W3C XML Schema version. At the
same time a W3C working group goes ahead and uses it anyway).
Boris
More information about the xsd-users
mailing list