Which is equivalent to the "sequence" in the xsd schema (but without ordering)

I have some types with a sequence inside, which limits the order of the children. I want to remove these restrictions for the order. Which element should I choose if I cannot (or do not want) change the definition of child elements? For example, if I were to change using <xs:choise maxOccurs="unbounded"> , it would not be the full equivalent of <xs:sequence> , because some children, which should initially appear only once, may appear several times. And vice versa, I can not use xs:all , since now I will have a limit on the maximum number of elements (no more than 1).

So, is there a simple and quick solution? (to make as few changes to the circuit as possible)

+4
source share
2 answers

Short answer: you cannot.

The parameter would have to determine the type for each combination of node sequences that are possible, and then wrap them in a, but that would be a bit ridiculous.

+2
source

You can wrap <sequence> in <choice> .

 <choice> <sequence> <!-- list your choices here --> </sequence> </choice> 
0
source

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


All Articles