specifying conditional elements

Discussion in 'XML' started by aborchers@sdsc.edu, May 5, 2005.

  1. Guest

    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
    , May 5, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alec S.
    Replies:
    10
    Views:
    10,091
    Alec S.
    Apr 16, 2005
  2. Replies:
    2
    Views:
    792
    Henry S. Thompson
    Dec 7, 2005
  3. Guest
    Replies:
    3
    Views:
    13,502
    Walter Wang [MSFT]
    Jul 27, 2006
  4. dmc
    Replies:
    3
    Views:
    395
  5. Tescobar
    Replies:
    12
    Views:
    488
    Vyacheslav Kononenko
    Jul 25, 2005
Loading...

Share This Page