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

RE: Re: RE : Text or tags choice with XSD

  • To: "Chiusano Joseph" <chiusano_joseph@b...>,"GARNIER Pierre" <pgarnier@m...>
  • Subject: RE: Re: RE : Text or tags choice with XSD
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Tue, 9 Sep 2003 07:07:44 -0700
  • Cc: <xml-dev@l...>
  • Thread-index: AcN22JY9s+kJh5mNR0GKLObR/pySlwAAatPa
  • Thread-topic: Re: RE : Text or tags choice with XSD

choice xsd tag
That would be a neat trick. Do you have an example of what the schema definition would be? I've always been of the impression that such content models are not describable with W3C XML Schema. 
 
 

________________________________

From: Chiusano Joseph [mailto:chiusano_joseph@b...]
Sent: Tue 9/9/2003 6:44 AM
To: GARNIER Pierre
Cc: 'xml-dev@l...'
Subject:  Re: RE :  Text or tags choice with XSD



Oops - I forgot about that. Then you should probably use abstract types
(see section 4.7 Abstract Elements and Types of the Schema Primer) and
use xsi:type in your instance document to define which type is being
used at runtime.

Kind Regards,
Joe Chiusano
Booz | Allen | Hamilton

GARNIER Pierre wrote:
>
> No, union are not usable within complex types.
>
> > Pierre,
> >
> > This can be done with Union types [1].
> >
> > Kind Regards,
> > Joe Chiusano
> > Booz | Allen | Hamilton
> >
> > [1] http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/primer.html#UnionDt
> >
> > GARNIER Pierre wrote:
> > >
> > > Hi,
> > >
> > > Here are two <time> elements differing only in there content :
> > >
> > > 1)
> > > <doc>
> > >   <time>14:09<time>
> > > </doc>
> > >
> > > 2)
> > > <doc>
> > >   <time><hour>14</hour><min>09</min></time>
> > > </doc>
> > >
> > > In an XSD schema, how to indicate that the <time> element can contain
> > > text and only text or <hour> tag followed by <min> tag?
> > >
> > > I tried with a choice group containing two <time> elements with
> > > different types but it doesn't work : it is not possible to have two
> > > elements with the same name.
> > >
> > > Thanks.
> > > Pierre.
> > >
> > > -----------------------------------------------------------------
> > > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> > > initiative of OASIS <http://www.oasis-open.org>
> > >
> > > The list archives are at http://lists.xml.org/archives/xml-dev/
> > >
> > > To subscribe or unsubscribe from this list use the subscription
> > > manager: <http://lists.xml.org/ob/adm.pl>
> > 


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.