Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Re: Defining recursive elements? >Thread Next - Re: Defining recursive elements? RE: Defining recursive elements?To: "'Andrew Welch'" <andrew.j.welch@-----.--->, "'Todd Moon'" <tmrfcm@-----.---> Date: 5/17/2007 4:30:00 PM > Well it's a matter of taste, but if you use the venetian > blind style of schema then you wouldn't use element ref="" > much, but @type instead, eg: > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> > > <xs:element name="part" type="part"/> > > <xs:complexType name="part"> > <xs:sequence> > <xs:element name="part" type="part" minOccurs="0" > maxOccurs="unbounded"/> > </xs:sequence> > <xs:attribute name="serial" type="xs:string"/> > </xs:complexType> > I'm not sure it's just a matter of taste. It feels wrong to me to have two element declarations for element part, one global and one local, when all the part elements are the same. It gives the same answers as far as validation of instances is concerned, but it seems a messier component model, which could give you a messier translation into classes when you do data binding, for example (I don't know if that's actually the case). Michael Kay http://www.saxonica.com/ From mike@s... Thu May 17 14:32:21 2007 Received: from lisa | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
