A
aborchers
Is it possible to specify conditonals within an xsd? For example,
consider the following two possible xml inputs:
Input A:
<comparison>
<left_operand>x</left_operand>
<operator>greater_than</operator>
<right_operand>x</right_operand>
</comparison>
Input B:
<comparison>
<left_operand>x</left_operand>
<operator>null</operator>
</comparison>
What I would like to do is the following: If the value of <operator> is
either "greater_than", "less_than", or "equals", then element
<right_operand> must be present. If the value of <operator> is "null"
or "not_null" then <right_operand> should not be present.
My guess is this may be beyond what xsd can handle, but I just thought
I'd ask the experts....
Thanks
consider the following two possible xml inputs:
Input A:
<comparison>
<left_operand>x</left_operand>
<operator>greater_than</operator>
<right_operand>x</right_operand>
</comparison>
Input B:
<comparison>
<left_operand>x</left_operand>
<operator>null</operator>
</comparison>
What I would like to do is the following: If the value of <operator> is
either "greater_than", "less_than", or "equals", then element
<right_operand> must be present. If the value of <operator> is "null"
or "not_null" then <right_operand> should not be present.
My guess is this may be beyond what xsd can handle, but I just thought
I'd ask the experts....
Thanks