You can solve both of these problems with a binding file. The source generator binding file allows you to rename the classes for individual elements & complexTypes (a solution to (1) and (2)) or to add suffixes to all elements and/or complexTypes (a solution to (1)).
http://castor.exolab.org/sourcegen.html#Binding-File
Rhett
Fredo Corleone wrote:
I have the following snippets of xml schema thats giving me agita. Please suggest the best way to handle the problems without making changes to the original schema if possible.
-----schema 1------
<xsd:complexType name="a.b">
<xsd:complexContent>
<xsd:extension base="p.q.r">
<xsd:sequence>
<xsd:element name="a_b" nillable="true">
::: :::
::: :::
---end schema 1---
Castor sourceGenerator maps both the complexType a.b and the element a_b to the same java class - A_b, in the file A_b.java, which creates problems when unmarshalling the xml associated with this schema.
I could change a.b to some other unique string, but that would be a last resort measure since this snippet comes from a large schema specification, written and maintained by another company. So, what is the best way to work around this problem?
---schema 2---
<xsd:complexType name="aaa">
<xsd:complexContent>
<xsd:extension base="bbb">
<xsd:sequence>
<xsd:element name="group_of_fields" maxOccurs="unbounded">
::: :::
::: :::
<xsd:complexType name="zzz">
<xsd:complexContent>
<xsd:extension base="bbb">
<xsd:sequence>
<xsd:element name="group_of_fields" maxOccurs="unbounded">
::: :::
::: :::
-----end schema 2----
The element group_of_fields appears in multiple complexTypes and each instance of group_of_fields contains a different set of elements. Since all of the group_of_fields elements are in the same namespace, only one Group_of_fields.java file is generated, which again creates problems during unmarshalling. Help!
I'm using org.exolab.castor.builder.javaclassmapping=type
_________________________________________________________________
There are now three new levels of MSN Hotmail Extra Storage! Learn more. http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
