It is possible to use xs:choice element inside xs:sequence,
<xs:sequence>
<xs:choice>...</xs:choice>
</xs:sequence>
but not inside xs:all. Why is that? Does that create some ambiguity when parsing xml?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This can only really be answered by the designers of XML Schema. You could pose it to the XSD newsgroup (xmlschema-dev@w3.org). My guess is that ambiguity and/or complexity are the problem.
For example of an ambiguity, consider having an all group with two children that are choice groups and each of those has an element named ‘X’, of two different types. When an X element is encountered by the parser, which X is it: the one belonging to the first choice group or to the second choice group (note that it does matter, because you must know which type to validate it with)? Perhaps the designers could have specified constraints to avoid such ambiguities, but perhaps doing that was just too complex and not worthwhile.