开发者

Writing XSD schema: if one field contains "A", then other field should not contain "B". How?

A simple scenario: if one field contains "A", then the other field should not contain "B". How to write a XSD schema for it. Example:

<root>
<field_1>A</field_1>
<field_2>B</field_2>开发者_如何学运维;
</root>

How to write an XSD schema that imposes restriction on the value of an element, depending on the value of another element?


You cannot do this in XML Schema 1.0 - you need to look elsewhere, like at Schematron or Relax NG for those kinds of validations.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜