specifying conditional elements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aborchers@sdsc.edu

    specifying conditional elements

    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>great er_than</operator>
    <right_operand> x</right_operand>
    </comparison>

    Input B:
    <comparison>
    <left_operand>x </left_operand>
    <operator>nul l</operator>
    </comparison>


    What I would like to do is the following: If the value of <operator> is
    either "greater_th an", "less_than" , or "equals", then element
    <right_operan d> must be present. If the value of <operator> is "null"
    or "not_null" then <right_operan d> 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

Working...