XML Schema Question

Raphael A. Bauer

Usenet Archive
Joined
Dec 14, 2004
Messages
3
Reaction score
0
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
 

szomiz

Usenet Archive
Joined
Dec 15, 2004
Messages
11
Reaction score
0
w said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top