Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Defining recursive elements?

From: "Pete Cordell" <petexmldev@--------------.--->
To: "Andrew Welch" <andrew.j.welch@-----.--->, "Michael Kay" <mike@--------.--->
Date: 5/17/2007 5:58:00 PM
----- Original Message From: "Andrew Welch" <...>
To: "Michael Kay" <...>
Cc: "Todd Moon" <...>; <...>


>
> On 5/17/07, Michael Kay <mike@s...> wrote:
>> > 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).


It may also depend on whether the global element 'part' is the only element 
to have type 'part'.  And also depends on whether you might want to add 
another element of type 'part' later (although it's not impossible to tweak 
that when the need arises!).

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML Schema to C++ data binding visit
 http://www.tech-know-ware.com/lmx/
 http://www.codalogic.com/lmx/
============================================= 



From dmarcus@n... Thu May 17 15:58:40 2007
Received: from lisa.w3.org ([128.30.52.41]


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent