Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Exchangeable top-elements in XML Schema?

Reply
Thread Tools

Exchangeable top-elements in XML Schema?

 
 
Richard Smol
Guest
Posts: n/a
 
      06-06-2005
How can I describe in an XML Schema definition that there are
several top-elemt names possible? IK mean something like
this:

<SomeTopElement>
<!-- rest goes here -->
</SomeTopElement>

or:

<OtherTopElement>
<!-- rest goes here -->
<OtherTopElement>

I looked at unions but get the idea that those only
work with enclosing elements. Is that true?

Thanks in advance for any input.

RS

 
Reply With Quote
 
 
 
 
Priscilla Walmsley
Guest
Posts: n/a
 
      06-06-2005
Hi,

Any element declaration that is global (i.e. the direct child of the
xs:schema element) can be used as the root element.

So, you don't have to do anything special to indicate that an element
can be the root, just declare both SomeTopElement and OtherTopElement
globally. If they both contain the same content, you can give them the
same type.

Hope that helps,
Priscilla

----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
http://www.datypic.com
----------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
 
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
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
embedding xml in xml as non-xml :) Mark Van Orman XML 5 09-15-2004 05:57 AM
What XML technologies to learn first for "XML Processing" and "XML Mapping"? Bomb Diggy Java 0 07-28-2004 07:26 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments