XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] XML Schema quiz: 3 elements and at least one must bepresent

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS