Hi Sree,
how about: http://castor.codehaus.org/how-to-map-a-collection.html
Having said that your tag names relate to the class of the object in the
collection. In other words, for every item in the collection you will
get a <item> tag. While these <item> tags may have different attribute
values and subelements, the name of the <item> tag can not change. You
will not be able to get <item1> and <item2> tags for objects of Item
class. If you have objects of different classes in your collection you
are able to define that objects of Foo class produce a <foo> tag and
objects of Bar class produce a <bar> tag.
Regards
Ralf
sbasani schrieb:
> Ralf,
>
> Thanks for the reply.
>
> You are concentrating on the example I am explained initially.
>
> But, that just sample example.
>
> In runtime only it'll be decided, how many parameters we are going to have
> and based on that parameters we have to create the xml file. We can't
> predict the xml file structure at initial stage.
>
> For ex:
>
> <Supermarket>
> <Item1></Item1>
> <Item2></Item2>
> <Item3></Item3>
> <Item4></Item4>
> <Item5></Item5>
> <Item6></Item6>
> <Item7></Item7>
> ....
> ....
> ....
> ....
> </Supermarket>
>
> Like the above example, initially we don't no how many items are there.
> Based on the requirement in runtime we have to decide..
>
> For clear understanding...
>
> <xmlfile>
> <supermarket>
> <name></name>
> <order>
> <Item1></Item1>
> <Item2></Item2>
> <Item3></Item3>
> <Item4></Item4>
> <Item5></Item5>
> <Item6></Item6>
> <Item7></Item7>
> </order>
> <order>
> <Item1></Item1>
> <Item2></Item2>
> <Item3></Item3>
> </order>
> <order>
> <Item1></Item1>
> <Item2></Item2>
> <Item3></Item3>
> <Item4></Item4>
> <Item5></Item5>
> </order>
> </supermarket>
> <xmlfile>
>
> In the above xml file, parent tags are fixed like super tag <xmlfile>,
> <order> and sub parent tag <Supermarket>, but the attributes(Items) of
> <Supermarket> are not defined (as fixed number of items we will get). We can
> say like 'n' number of Items can come.
> Is there any way to define Items as collection?
>
> Please let me know, if you need any clarification.
>
> Thanks & Regards,
> Sree
--
Syscon Ingenieurbüro für Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Internet: www.syscon.eu
E-Mail: [EMAIL PROTECTED]
Sitz der Gesellschaft: D-72127 Kusterdingen
Registereintrag: Amtsgericht Stuttgart, HRB 382295
Geschäftsleitung: Jens Joachim, Ralf Joachim
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email