限制XSD中的专用键值对

时间:2022-12-15 17:18:52

In the XSD, there are two elements, A and B. They are siblings.

在XSD中,有两个元素,A和B.它们是兄弟姐妹。

A can have a value of either "1" or "2". B can have a value of either "one" or "two".

A的值可以是“1”或“2”。 B可以具有“一”或“两”的值。

I want to restrict this, however, so that only "1-one" and "2-two" are valid combinations, not "1-two" or "2-one". Is there a way of doing that in the XSD?

但是,我想限制它,因此只有“1-one”和“2-two”才是有效组合,而不是“1-two”或“2-one”。有没有办法在XSD中这样做?

1 个解决方案

#1


2  

Schematron can be used to define such co-occurrence constraints. You can find some introductory articles here:

Schematron可用于定义此类共现约束。你可以在这里找到一些介绍性文章:

#1


2  

Schematron can be used to define such co-occurrence constraints. You can find some introductory articles here:

Schematron可用于定义此类共现约束。你可以在这里找到一些介绍性文章: