Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schema Question

Reply
Thread Tools

XML Schema Question

 
 
Raphael A. Bauer
Guest
Posts: n/a
 
      12-14-2004
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
 
Reply With Quote
 
 
 
 
szomiz
Guest
Posts: n/a
 
      12-15-2004
Msio <(E-Mail Removed)-berlin.de>, w
news:cpmhle$h1o$(E-Mail Removed)-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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments