We are using legacy system that does not conform to XML model. Our
enterprise code has to read the way it was presented. Do you know of
if-else switch we could do in Castor mapping.xml file?

Thanks,

David



|---------+---------------------------->
|         |           "Keith Visco"    |
|         |           <[EMAIL PROTECTED]|
|         |           >                |
|         |                            |
|         |           02/28/2005 02:39 |
|         |           PM               |
|         |           Please respond to|
|         |           castor-dev       |
|         |                            |
|---------+---------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                 |
  |       To:       castor-dev@exolab.org                                       
                                                 |
  |       cc:                                                                   
                                                 |
  |       Subject:  Re: [castor-dev] Castor XML - duplicate bind-xml names      
                                                 |
  
>------------------------------------------------------------------------------------------------------------------------------|





Hi David,

How do you distinguish between whether something is a Contract or a
Payment if they both use the Contract element name?

Castor basically follows the rules set forth in XML Schema, which
doesn't allow two sibling elements to have the same name and different
types. Basically if you have to look at the child-elements to determine
the type it's not going to work well. Castor determines the type before
examining the child elements.

--Keith

[EMAIL PROTECTED] wrote:
> Hi,
>
> I have a Response POJO that has two attributes: contracts and payments.
The
> XML message I receive from SOAP for the <Response/> element can have only
> one sub-element whether contract or payment, cannot be both at the same
> time. Castor gives error because I have two same bind-xml element names
> (contract and payment have the same element name <Contract/>). How do you
> work around this issue?
>
> <Response>
>   <Contract primaryKey="">
>   </Contract>
> </Response>
>
> <class name="com.domain.function.Response">
>  <field name="_contracts" type="com.domain.function.Contract" collection=
> "arraylist" set-method="setContracts" get-method="getContracts">
>       <bind-xml name="Contract"/>
>  </field>
>  <field name="_payments" type="com.domain.function.Payment" collection=
> "arraylist" set-method="setPayments" get-method="getPayments">
>       <bind-xml name="Contract"/>
>  </field>
> </class>
>
> <class name="com.domain.function.Contract">
>  ...
> </clase>
>
> <class name="com.domain.function.Payment">
>  ...
> </clase>
>
>
>
>
>
------------------------------------------------------------------------------

> Electronic Privacy Notice. This e-mail, and any attachments, contains
information that is, or may be, covered by electronic communications
privacy laws, and is also confidential and proprietary in nature. If you
are not the intended recipient, please be advised that you are legally
prohibited from retaining, using, copying, distributing, or otherwise
disclosing this information in any manner. Instead, please reply to the
sender that you have received this communication in error, and then
immediately delete it. Thank you in advance for your cooperation.
>
==============================================================================

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





------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and proprietary in nature. If you are not the 
intended recipient, please be advised that you are legally prohibited from 
retaining, using, copying, distributing, or otherwise disclosing this 
information in any manner. Instead, please reply to the sender that you have 
received this communication in error, and then immediately delete it. Thank you 
in advance for your cooperation.
==============================================================================



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to