Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - XML Schema quiz: 3 elements and at least one must be present [Thread Next] Re: [xml-dev] XML Schema quiz: 3 elements and at least one must be presentTo: "Costello, Roger L." <costello@-----.---> Date: 8/14/2008 1:02:00 PM > 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>
?
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
