Suppose I have an XML element, food
, that can take on one of two forms:
<food kind="juice" />
<food kind="fruit" sort="apple" />
In my XSD I would like to specify that the sort
attribute can only exist for the <food>
element iff the kind="fruit"
. The attribute sort
would not be acceptable for other kind
values. It looks like a simple attribute implication might work but I could not find more details on this.
How can I specify such a dependency?