Hello all,

I have a question about XML mapping.
I have a class which looks like this:

public  class GlobalEnvironment{
        public double accelerationOfGravity ;
        public double densityWater ;
        public double densityAir ;
        public double viscosityWater;
        public double temperatureWater;
        public double salinityWater ;

}

I want the XML structure for GlobalEnvironment instances as follows:

<GlobalEnvironment>
        <Water>
                <Viscosity>34</Viscosity>
                <Density>1.0</Density>
                <Temperature>100</Temperature>
                <Salinity>34</Salinity>         
        </Water>
        <Gravity>10.0</Gravity>
        <Air>
        <Density>0.00123</Density>
         </Air>
</GlobalEnvironment>

I mean I want that the fields ...Water in the class are residing under
element <Water>, and respectively for air. 
Of course it is possible to create this XML structure by changing the
class definition a little bit, but what I want is not this.  Is it
possible to map this class definition to such an XML structure? Or is it
must for me either to change the XML representation of the
GlobalEnvironment class or change the GlobalEnvironment and add some
classes Water, Air ...?

I tried using location attribute setting location="Water" for mapping of
fields densityWater,viscosityWater,temperatureWater and salinityWater
but it did not give the result I wanted. The mapping packed the fields
in different "Water" elements.

I hope my problem is clear.

Regards,
Sunay 
 
 
 
This e-mail contains confidential information for the exclusive attention of the 
intended addressee. Any access of third parties to this e-mail is unauthorised. Any 
use of this e-mail by unintended recipients such as copying, distribution, disclosure 
etc. is prohibited and may be unlawful. When addressed to our clients the content of 
this e-mail is subject to the General Terms and Conditions of GL's Group of Companies 
applicable at the date of this e-mail.  
 
GL's Group of Companies does not warrant and/or guarantee that this message at the 
moment of receipt is authentic, correct and its communication free of errors, 
interruption etc.  
 

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

Reply via email to