How about reading the section about the castor mapping first, try a few
things, and if there's some outstanding questions, come back here and ask ?
Werner
Logu... wrote:
> Ya i too thought of that.
> My doubt is how to write a mapping file for the given XML structure & the
> Java Classes..
>
> Idea is to map every xml element to the the generic object called
> MessageDetail class.
> Root tag needs to be repersented by Message class. The stucture of them is
> given below..
>
> Please help to create an mapping file
>
>
>
> Werner Guttmann wrote:
>> How about writing a mapping file that maps the individual XML artefacts
>> to your Java classes/member variables ?
>>
>> Werner
>>
>> Logu... wrote:
>>> I have two Java classes.. namely
>>> 1) Mesasge
>>> 2) MessageDetail
>>>
>>> Structure
>>>
>>> public class Message {
>>> private List<MessageDetails> messageDetails;
>>> ........ //Setters & getters
>>> }
>>>
>>> public class MessageDetails{
>>> private String key;
>>> private String value;
>>> private List<MessageDetails> children;
>>> ........ //Setters & getters
>>> }
>>>
>>>
>>> The requirement is when i recieve an xml like below i need to create
>>> object
>>> as above.
>>> Please help me to create mapping file.. am new to castor
>>>
>>> <?xml version="1.0"?>
>>> <loy:createproducts >
>>> <loy:productDef>
>>> <loy:product name = "Shiptest" >
>>> <loy:articlenumber name = "PRD2003" />
>>> <loy:redemptiontype description = "B" />
>>> <loy:category code = "CAT2" />
>>> <loy:price
>>> retailprice = "55555"
>>> specialprice = ""
>>> releasedate = "22/Mar/2006"
>>> />
>>> <loy:productdescription value = "prd des" />
>>>
>>>
>>> <loy:auctionattributes
>>> minimummerchantprice = "1"
>>> standardbrokermargin = "1"
>>> minimumbrokermargin = "1"
>>> releasedate = "22/Mar/2006"
>>> closingdate = "22/Mar/2006"
>>> auctionduration = "1"
>>> maxquantityperauction = "1"
>>> />
>>> </loy:product>
>>> </loy:productDef>
>>>
>>> </loy:createproducts>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email