specifying conditional elements

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,841
Latest member
WilmerBelg

Latest Threads

Top