Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Defining recursive elements?

From: Boris Kolpackov <boris@-------------.--->
To: xmlschema-dev@--.---
Date: 5/18/2007 12:22:00 AM
Hi,

Andrew Welch <andrew.j.welch@g...> writes:

> 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>
>
> </xs:schema>

Note that this change will result in a different schema if there
was a target namespace involved. In the original example, both
elements are qualified while in this schema the global one would
be qualified while the local one wouldn't.


Michael Kay <mike@s...> writes:

> ... 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).

I don't think this design would cause any problems in data binding since
most tools would translate types to classes and there is only one type
involved. The local part element would normally end up being translated
to a member function in that class while the global one could be mapped
to something that can parse a document (e.g., a global function).

hth,
-boris


--
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

From noah_mendelsohn@u... Thu May 17 21:04:02 2007
Received: from aji.w3.org ([133.27.228.


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