开发者

can the length of two xml lists be defined as being required to be equal?

开发者 https://www.devze.com 2022-12-23 07:58 出处:网络
Assuming you have two lists defined in an xml schema, call them A and B, is there a way to say A must be o开发者_JAVA百科ne or more items and B must be the same length as A?As an alternative to storin

Assuming you have two lists defined in an xml schema, call them A and B, is there a way to say A must be o开发者_JAVA百科ne or more items and B must be the same length as A?


As an alternative to storing

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

and enforcing the same length, you could try storing:

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

This way the constraint you need to enforce would be that each element from AB is of length two and consists of the types A and B - this should be possible in a normal schema.


Co-occurrence constraints are not supported in XSD 1.0. In XSD 1.1 which is still in a draft stage, they are. So, sadly, no.

0

精彩评论

暂无评论...
验证码 换一张
取 消