No in XSL Schema there is no possibility to do that.
There are two ways you can achieve what you want:
If you really have to stick with XSD-Schema:
- Using Schematron transformation and defining those rules
If you're not forced to use XSD-Schema by your environment
- you should really use Relax NG instead.
In Relax NG you have much more possibilitys to express complex behaviour. And on top its much easier to write and understand than XSD Schema.
In Relax NG what you want to express would look like this (you would define your element 3 times in a choice)
<choice>
<element name="fruit-combination">
<element name="fruit">
<value>apple</value>
<element>
<element name="colour">
<value>red</value>
</element>
</element>
<element name="fruit-combination">
<element name="fruit">
<value>orange</value>
<element>
<element name="colour">
<value>orange</value>
</element>
</element>
<element name="fruit-combination">
<element name="fruit">
<value>watermelon</value>
<element>
<element name="colour">
<value>green</value>
</element>
</element>
</choice>
The Relax NG implementation will then choose the right element for you. If you're using a good xml editor and you put your apple element in the file it will even restrict you so that you can only add an colour element with value red and so on.
In Schematron you would just write a rule for your colour element with value red is only valid if there is a fruit element with value apple in it. Schematron itsself is nothing but a special XSL-Transformation which applys some rules to the xml document and outputs a report of the Errors and Warnings in XML Form.
See:
http://relaxng.org/
http://www.schematron.com/ (Specification)
http://www.schematron.com/implementation.html (Implementation)