Hi,

that is not really achievable, in my opinion.

But let me just describe how I'd go about the same business when
starting with XML schema. There, I'd define a complexType definition
that holds all required content for your addresses, i.e. elements and/or
attributes.

Next, I'd create several XML schemas with complexType defs in there that
extend the original address complexType. Per definition, each extension
would get its own namespace as they all reside in separate XML schemas
(each with its own targetNamespace).

Finally, I would create a complexType definition for 'Adresses', with a
choice of all possible 'Address' instances.

This probably could be simulated in a mapping file, but you'd have to
create several XAddress classes that extend Address, and map them
individually.

I hope this helps.

Regards
Werner

kabal wrote:
> hi there
> 
> I have one address class, that I want to map all address data into, however,
> sometimes the element is a different name and namespace.
> 
> <ns3:Addresses xmlns:ns3="http://namespace/integration/Profile/1.0";>
>       <ns7:AddressLine1
> xmlns:ns7="http://namespace/integration/Address/1.0";>Address Line
> 1</ns7:AddressLine1>
>       ...
> </ns3:Addresses>
> 
> <ns4:ShippingAddress>
>       <ns5:AddressLine1
> xmlns:ns5="http://namespace/integration/Address/1.0";>Address Line
> 1</ns5:AddressLine1>
>       ...
> </ns4:ShippingAddress>
> 
> 
> both these can be included in a response from the webservice (not
> implemented by us, and therefore not changable)
> 
> existing mapping that works for one of the elements
> 
> <class name="mypackage.AddressImpl">
>       
>               <map-to xml="Address"
>                       ns-uri="http://namespace/integration/Address/1.0";
>                       ns-prefix="ns4" />
>                       
>                       ....
> </class>
> 
> if I try declare twice, I get the
> org.exolab.castor.mapping.MappingException: A mapping for class
> mypackage.AddressImpl already exists exception.
> 
> any way for me to achieve this???
> 
> Thanks in advance
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to