tags:

views:

74

answers:

1

This is more of an generic XML Schema question, but if and how do you specify field dependencies in an XML Schema. For example, how would I say fieldB is required, if fieldA is provided ???

A: 

You could fake this using <choice> and/or <sequence>. For example, you could allow either nothing, fieldB, or fieldA and fieldB, but not just fieldA. This could lead to duplication, which you could prevent by defining a complexType.

Erik Hesselink