Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Schema issue >Thread Next - Re: Schema issue Re: Schema issueTo: NULL Date: 3/21/2009 5:20:00 AM On Mar 20, 9:45=A0am, "Rahul" <reach_aggar...@hotmail.com> wrote: > Hi, > > I have to define a schema as below but this is not valid according to sch= ema > rules. > > It violates the followign rule because I have element B as minOccurs =3D = 0. It > is fine if I make B as MinOccurs =3D 1. > > http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#cos-nonambig > > How can I have define the schema in this situation so as to not violate t= he > above rule. > > <?xml version=3D"1.0" encoding=3D"UTF-8"?> > > <xsd:schema xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" > xmlns=3D"http://test.xsd" targetNamespace=3D"http://test.xsd" > elementFormDefault=3D"qualified" attributeFormDefault=3D"unqualified"> > > <xsd:element name=3D"X" type=3D"X"/> > > <xsd:complexType name=3D"X"> > > <xsd:sequence> > > <xsd:element name=3D"A" type=3D"xsd:string" minOccurs=3D"0" > maxOccurs=3D"unbounded"/> > > <xsd:element name=3D"B" type=3D"xsd:string" minOccurs=3D"0" maxOccurs=3D"= 1"/> > > <xsd:element name=3D"A" type=3D"xsd:string" minOccurs=3D"0" > maxOccurs=3D"unbounded"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:schema> > > Thanks > > Rahul The only problem I see is multiple definitions of an element (i.e., element 'A'). Rename the last element 'C' and you should be fine. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
