Limit exclusive key-value pairs in XSD

There are two elements to the XSD: A and B. They are siblings.

A may have a value of "1" or "2". B may be one or two.

I want to limit this, however, so that only β€œ1-on” and β€œ2-two” are valid combinations, not β€œ1-two” or β€œ2-one.” Is there any way to do this in XSD?

+3
source share
1 answer

Schematron can be used to identify such co-occurrence constraints. Here you can find some introductory articles:

+2
source

All Articles