Xs: select inside xs: all

You can use the xs: select element inside xs: sequence,

<xs:sequence> <xs:choice>...</xs:choice> </xs:sequence> 

but not inside xs: all. Why is this? Does this create some ambiguity when parsing xml?

+4
source share
1 answer

Only XML Schema developers can answer this. You can submit it to the XSD newsgroup ( xmlschema-dev@w3.org ). I assume the problem of ambiguity and / or complexity is the problem.

For example, because of the ambiguity, consider having an entire group with two children, which are selectable groups, and each of them has an element named "X" of two different types. When the X element is encountered by the parser, then X is the one that belongs to the first choice group or the second selection group (note that this matters because you need to know what type to check for)? Perhaps designers could indicate limitations to avoid such ambiguities, but maybe it was too complicated and not worth it.

+3
source

Source: https://habr.com/ru/post/1379856/


All Articles