469,644 Members | 1,749 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

XML Schema Question

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
Jul 20 '05 #1
1 1599
Msio <ra***********@informatik.hu-berlin.de>, w
news:cp**********@hahn.informatik.hu-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.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Antony | last post: by
1 post views Thread by Gregg Williams | last post: by
2 posts views Thread by PeterW | last post: by
4 posts views Thread by cmc | last post: by
1 post views Thread by brucepickford001 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.