Can the length of two xml lists be defined as mandatory for peers?

Assuming you have two lists defined in an xml schema, name them A and B, is there a way to say that A should be one or more elements and B should be the same length as A?

+2
source share
2 answers

As an alternative to storage

A = (a, a, a) B = (b, b, b) 

and observing the same length, you can try:

 AB = ([a,b], [a,b], [a,b]) 

Thus, the restriction that you need to ensure will be that each element from AB has a length of two and consists of types A and B - this should be possible in the usual scheme.

+1
source

Coexistence constraints are not supported in XSD 1.0 . In XSD 1.1 , which is still under construction, they are. Unfortunately not.

0
source

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


All Articles