XML Schema Question

Discussion in 'XML' started by Raphael A. Bauer, Dec 14, 2004.

  1. Hi!

    I have the folwing problem with my xml schema. I want the xml file to
    look like:


    <elementONE>
    ...
    </elementONE>

    ---OR----

    <elementTWO>
    ...
    </elementTWO>


    The problem is that I don't know how to formulate this "OR" within the
    XML Schema. I think about using something like
    <xs:complexType>
    <xs:choice>
    <xs:element name="elementONE">
    ...
    </xs:element>
    <xs:element name="elementTWO">
    ...
    </xs:element>
    </xs:choice>
    </xs:complexType>


    But that doesn't work out because for that I would imho need a
    surrounding named element, but I don't want a new surrounding element.
    I just want something like
    xs:element name="elementONE"|name="elementTWO"
    - to say - in fact the elementONE and elementTWO contain the same
    content, but they differ only in the name because of "historical" reasons...

    Any hints for a frustrated schema (re)maker?

    Many thanks in advance,

    Raph
     
    Raphael A. Bauer, Dec 14, 2004
    #1
    1. Advertising

  2. Raphael A. Bauer

    szomiz Guest

    Msio <-berlin.de>, w
    news:cpmhle$h1o$-berlin.de zeznal:

    > I just want something like
    > xs:element name="elementONE"|name="elementTWO"
    > - to say - in fact the elementONE and elementTWO contain the same
    > content, but they differ only in the name because of "historical"

    reasons...

    <xs:schema ...>
    ...
    <xs:element name="elementONE" type="OneTwoElem"/>
    <xs:element name="elementTwo" type="OneTwoElem"/>
    ...
    <xs:complexType name="OneTwoElem">
    ...
    </xs:complexType>
    </xs:schema>

    sz.
     
    szomiz, Dec 15, 2004
    #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. Markus
    Replies:
    1
    Views:
    1,613
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    968
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    470
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,296
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    2,957
Loading...

Share This Page