xml schema tricks

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?
[611 byte] By [ranadhir nag] at [2007-11-20 1:38:16]
# 1 Re: xml schema tricks
schematron may be your best bet; it's not possible to do co-ocurrence constraints in xml schema.
jkmyoung at 2007-11-10 3:26:55 >