xsd condition

Discussion in 'XML' started by Lucia, Oct 22, 2003.

  1. Lucia

    Lucia Guest

    Hello,

    I'd like to write an XML-Schema which has the following structure:

    <xsd: complexType name="example">
    <xsd: element name="variablename" type="xsd:string"/>
    <xsd: element name="variabletype" type="xsd:string"/>
    <xsd: element name="variablevalue" type=?????????? />
    </xsd:complexType>

    My problem is that the type of the element "variablevalue" depends on
    the content of the element "variabletype".

    e.g. when variablevalue=long, the type of variablevalue should be
    "xsd: long";
    when variablevalue=string, the type of variablevalue should be
    "xsd: string";

    How can solve this problem? Have you any idea?

    Thanks

    lucia
    Lucia, Oct 22, 2003
    #1
    1. Advertising

  2. Lucia

    Martin Boehm Guest

    "Lucia" <> wrote in message
    news:

    > e.g. when variablevalue=long, the type of variablevalue should be
    > "xsd: long";
    > when variablevalue=string, the type of variablevalue should be
    > "xsd: string";
    >
    > How can solve this problem? Have you any idea?


    Create a simpleType for each of the possible variable types and then use
    xsd:union or xsd:choice to combine them.

    Martin
    Martin Boehm, Oct 22, 2003
    #2
    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. -
    Replies:
    12
    Views:
    676
    Remon van Vliet
    Jun 15, 2005
  2. Markus
    Replies:
    1
    Views:
    1,079
    Markus
    Nov 22, 2005
  3. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    468
    C. M. Sperberg-McQueen
    Sep 26, 2003
  4. Replies:
    1
    Views:
    845
    Martin Honnen
    Jan 14, 2004
  5. Bill W.
    Replies:
    13
    Views:
    279
    Phillip Gawlowski
    May 9, 2011
Loading...

Share This Page