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

Re: XML Schema quiz: 3 elements and at least one must bepresen

  • From: George Cristian Bina <george@o...>
  • To: Andrew Welch <andrew.j.welch@g...>
  • Date: Thu, 14 Aug 2008 17:01:03 +0300

Re:  XML Schema quiz: 3 elements and at least one must bepresen
That's nice, but there's no need to involve substitution groups to get 
the same result:

     <complexType name="ThreeElements">
         <choice maxOccurs="unbounded">
             <element name="A" type="string"/>
             <element name="B" type="string"/>
             <element name="C" type="string"/>
         </choice>
     </complexType>

But I believe Roger does not want to allow multiple occurrences of the 
same element while the above allows that.

Best Regards,
George
-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Andrew Welch wrote:
>> Consider this problem: you have 3 elements - A, B, C - and you need at
>> least one of them to be present in your XML instance document.
> 
> How about:
> 
>     <xs:element name="baseType"/>
> 
>     <xs:element name="A" substitutionGroup="baseType"/>
>     <xs:element name="B" substitutionGroup="baseType"/>
>     <xs:element name="C" substitutionGroup="baseType"/>
> 
>     <xs:complexType name="whatever">
>         <xs:sequence>
>             <xs:element ref="baseType" maxOccurs="unbounded"/>
>         </xs:sequence>
>     </xs:complexType>
> 
> ?
> 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.