Richard, et al.

As Ralf mentions the reason for the collision is both the ClaimsCost complexType and the ClaimsCost element as Castor, by default, will generate a class for both.

If you only want classes generated for the complexType and not the elements, you can configure Castor accordingly.

Please see the following:

http://castor.codehaus.org/sourcegen.html#Class-Creation/Mapping

--Keith

Ralf Joachim wrote:
Hi Richard,

here I hope to be able to help a little.

SourceGenerator generates classes for every complex type and element. The classes are named the same as the name of the complex type or element. In your case it wants to create:

- a class 'ClaimsCost' for
 <xs:complexType name="ClaimsCost">

- a class 'ClaimsCost' for
<xs:complexType name="ServiceType">
  <xs:sequence>
    <xs:element name="ClaimsCost" type="ClaimsCost"/>
  </xs:sequence>
</xs:complexType>


- a class 'ClaimsCost' for
<xs:complexType name="RxLevel">
  <xs:sequence>
    <xs:element name="ClaimsCost" type="ClaimsCost"/>
  </xs:sequence>
</xs:complexType>

As you may understand it is not possible to create 3 different classes with the same name in the same package. This is what the binding file is for, it allows you to tell SourceGenerator to give each class of the above cases a different name.

A name clash may not only occure on class level but also on properties of a class.

Ralf



Fishman, Richard schrieb:

Bill, I don't understand how that would help. My main problem is that I
just don't understand what the warning message is trying to tell
me...why SourceGenerator is having an issue...

-----Original Message-----
From: Bill Leng [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 2:38 PM
To: [email protected]
Subject: Re: [castor-user] [XML] Duplicate XML names in SourceGenerator

I would change your schema to something like
    <xs:complexType name="ClaimsCostType">
>>        <xs:attribute name="value" type="xs:string"
>>use="required"/>
>>    </xs:complexType>
>>    <xs:complexType name="ServiceType">
>>        <xs:sequence>
>>            <xs:element name="ClaimsCost"
>>type="ClaimsCostType"/>
>>        </xs:sequence>
>>    </xs:complexType>
>>    <xs:complexType name="RxLevel">
>>        <xs:sequence>
>>            <xs:element name="ClaimsCost"
>>type="ClaimsCost"/>
>>        </xs:sequence>
>>    </xs:complexType>
>></xs:schema>
>>
>>

Ralf Joachim wrote:
That's a thing I have to leave for others as I haven't used this myself until now.

Ralf


Fishman, Richard schrieb:

Thanks Ralf.

That's what I thought (mapping-binding.xml) but I can't figure out how

to do it...
-----Original Message-----
From: Ralf Joachim [mailto:[EMAIL PROTECTED]
Sent: Friday, January 20, 2006 1:13 PM
To: [email protected]
Subject: Re: [castor-user] [XML] Duplicate XML names in SourceGenerator

Hi Richard,

I#M not an expert on the XML side of castor but as far as I know you

should be able to resolve all of this warnings yb a binding file with 1
or 2 bindings.
For an example you may want to take a look at:

src/main/org/exolab/castor/mapping/mapping-binding.xml

Regards
Ralf
Castor JDO, committer


Fishman, Richard schrieb:


I'm definitely no expert on XML Schema and don't completely understand all the name collision issues that SourceGenerator must have to deal with but I can definitely understand the issues it would


have with some name duplications. But I can't understand why I am having the problem below. Why wouldn't SourceGenerator just create a ClaimsCost class and add it as a member variable to both the

ServiceType and RxLevel classes?
I read the SourceGenerator docs but it wasn't completely intuitive on


how to get around this in a generic fashion. I can't create a binding


for each of the warnings I'm getting because there are literally hundreds of them. The namingXML seems to be my ticket but I can't understand how to use it.

Here are some excerpts from an xsd (the whole xsd is HUGE with many includes so I hesitate to include it in the post):

<?xml version="1.0" encoding="UTF-8"?> <xs:schema elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    <xs:complexType name="ClaimsCost">
        <xs:attribute name="value" type="xs:string"
use="required"/>
    </xs:complexType>
    <xs:complexType name="ServiceType">
        <xs:sequence>
            <xs:element name="ClaimsCost"
type="ClaimsCost"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="RxLevel">
        <xs:sequence>
            <xs:element name="ClaimsCost"
type="ClaimsCost"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

Here are the warnings:
Warning: A class name generation conflict has occured between element


'complexTy pe:RxLevel/ClaimsCost' and complexType 'complexType:ClaimsCost'. Please use a Bi nding file to solve this problem.Continue anyway [not recommended] (y|n|?)y


Warning: A class name generation conflict has occured between element


'complexTy pe:ServiceType/ClaimsCost' and complexType 'complexType:ClaimsCost'.
Please use
a Binding file to solve this problem.Continue anyway [not recommended] (y|n|?)y


Warning: A class name generation conflict has occured between element


'complexTy pe:ServiceType/ClaimsCost' and complexType 'complexType:ClaimsCost'.
Please use
a Binding file to solve this problem.Continue anyway [not recommended] (y|n|?)y


Warning: A class name generation conflict has occured between element


'complexTy pe:RxLevel/ClaimsCost' and complexType 'complexType:ClaimsCost'. Please use a Bi nding file to solve this problem.Continue anyway [not recommended] (y|n|?)y


Warning: A class name generation conflict has occured between element


'complexTy pe:ServiceType/ClaimsCost' and complexType 'complexType:ClaimsCost'.
Please use
a Binding file to solve this problem.Continue anyway [not recommended] (y|n|?)y


Warning: A class name generation conflict has occured between element


'complexTy pe:RxLevel/ClaimsCost' and complexType 'complexType:ClaimsCost'. Please use a Bi nding file to solve this problem.Continue anyway [not recommended] (y|n|?)y

Regards,

Rick Fishman Technical Architecture Services
DCC 6-5 203, Ext. 51987
e-mail: [EMAIL PROTECTED]
Phone: (904) 905-1987
Website: http://tas.bcbsfl.com




Blue Cross Blue Shield of Florida, Inc., and its subsidiary and

affiliate companies are not responsible for errors or omissions in this
e-mail message. Any personal comments made in this e-mail do not reflect
the views of Blue Cross Blue Shield of Florida, Inc.  The information
contained in this document may be confidential and intended solely for
the use of the individual or entity to whom it is addressed.  This
document may contain material that is privileged or protected from
disclosure under applicable law.  If you are not the intended recipient
or the individual responsible for delivering to the intended recipient,
please (1) be advised that any use, dissemination, forwarding, or
copying of this document IS STRICTLY PROHIBITED; and (2) notify sender
immediately by telephone and destroy the document. THANK YOU.

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message
to the following address:

[EMAIL PROTECTED]
-------------------------------------------------







Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc. The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed. This document may contain material that is privileged or protected from disclosure under applicable law. If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to