Re: Problem using <xsd:all>
Hi Paul, Paul Stepowski wrote: > That is, I require either: > > <tasklist> > <success/> > <failure/> > </tasklist> > > or: > > <tasklist> > <failure/> > <success/> > </tasklist> I think your schema definition then should look something like: <xsd:element name="tasklist"> <xsd:complexType> <xsd:all> <xsd:element ref="success" minOccurs="1" maxOccurs="1" /> <xsd:element ref="failure" minOccurs="1" maxOccurs="1" /> </xsd:all> </xsd:complexType> </xsd:element> The <xsd:all> should do the job here, as to that one requirement. The problem with your first XSD was that you defined an <xsd:all> inside some <xsd:sequence>, where nesting <xsd:all> inside <xsd:sequence> doesn't work. If your <tasklist> may also contain other elements which you don't want to apply the rules of <xsd:all>, it could be a lot easier to wrap your special <success> and <failure> elements inside another element like: <tasklist> <foo /> <bar /> <status> <failure /> <success /> </status> </tasklist> This enables you to use desired <xsd:sequence> for <tasklist> and use the <xsd:all> for <status> containing only <failure> and <success>, each occurring once. Best Regards -- Dennis Sterzenbach
[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!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format