[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: representing content model in XML Schema

  • From: Jeni Tennison <mail@j...>
  • To: James Williams - Sun East Coast IR Development <James.P.Williams@S...>
  • Date: Fri, 20 Jul 2001 16:48:27 +0100

xml schema content model
Hi James,

> Can anybody tell me how to represent the following content group in
> XML Schema?
>
> (a|b|c)*

The | separators mean its a choice, so you use an xs:choice element:

  <xs:choice>
    ...
  </xs:choice>

The * means that it can occur between 0 and any number of times - that
gets translated into minOccurs="0" maxOccurs="unbounded".

  <xs:choice minOccurs="0" maxOccurs="unbounded">
    ...
  </xs:choice>

The a, b and c are references to elements that you've declared
globally, so you use xs:element elements with ref attributes giving
the names of the elements:

  <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="a" />
    <xs:element ref="b" />
    <xs:element ref="c" />
  </xs:choice>

Depending on the pattern you're using in your schema, you might
declare the elements locally within the group rather than referring to
globally declared elements.
  
I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.