thanks for listening,
Dean
Arnaud Blandin wrote:
Hi Dean,----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
I thought I included such an example in the documentation I wrote for
the Source Generator (the pdf one available online, the latest revision
is dated from July 2001 but it still presents the functionalities of the
Source Generator.).
If it is not in the doc, I will update it.
Thanks,
Arnaud
-----Original Message-----
From: Dean Hiller [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Differences between type-method and
element-method generation
Lo�c,
My answer is below. Hopefully it is pretty accurate.
Castor team,
Can someone copy this to the website(after correcting
possibly)? I know this would have helped me tremendously from the
beginning if I knew this up front.
Example XSD.....
<xsd:complexType name="something">
</xsd:complexType>
<xsd:complexType name="someOtherType">
</xsd:complexType>
<xsd:element name="TryMe" type="something">
<xsd:element name="Again">
<xsd:complexType>
<xsd:sequence>
<element name="lookMa" type="someOtherType"/>
<element name="lookMa2" type="someOtherType"/>
</xsd:sequence>
<xsd:complexType>
</xsd:element>
Element
----------------------------
would generate abstract class Something and SomeOtherType
would generate a TryMe class as subclass of Something
would generate a LookMa and LookMa2 class as subclasses of SomeOtherType
would generate a concrete Again class
Disadvantage here is the explosion of objects you can have. Notice the
LookMa and LookMa2 are generated even though there is only one type.
Also, you will get more naming conflicts(if someone else has an element
called LookMa, you will have to use the binding file to map it so there
is not a naming conflict)
Type
-----------------------------
would generate a concrete class Something and SomeOtherType and Again
Notice TryMe, LookMa, and LookMa2 are no longer generated
Disadvantage here is when you marshall the complexType, you need to know
what element to marshal it as.
Example, say there was another element <xsd:element name="TryMe2"
type="something"> and you have a "something" object, do you marshal it
as TryMe2 or TryMe?
I am thinking about adding a feild in the generated code called element
so the xml element can be retrieved by the unmarshaller. The element
could be set at construction time or a set method.
Dean
Lo�c Bertholet wrote:
hi,
I don't really understand the differences between these 2 ways of
generating sources with the sourceGenerator.
What is considered as a "top-level type" and a "top-level complexType" ?
A simple example of a XmlSchema which obtains 2 differents source code
after these 2 kind of generation would be great !
thanks,
Lo�c
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
