I need to define 2 rules in my schema .
The validated xml is of the form
<root>
<vegetable>
<class>root</radish>
<type>A</type>
<value>moderate</value>
</vegetable>
<vegetable>
...
...
</vegetable>
..
..
</root>
Condition 1: When class is 'seed' - element 'type' is optional else mandatory.
Condition 2: Atleast one 'vegetable' should have 'value' as 'benficial'.
How do i define these conditions in the schema?
The validated xml is of the form
<root>
<vegetable>
<class>root</radish>
<type>A</type>
<value>moderate</value>
</vegetable>
<vegetable>
...
...
</vegetable>
..
..
</root>
Condition 1: When class is 'seed' - element 'type' is optional else mandatory.
Condition 2: Atleast one 'vegetable' should have 'value' as 'benficial'.
How do i define these conditions in the schema?