Re: [Simple-support] Problem with using Element List
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2007-09-14 15:10:53
|
Hi Wessam,
You need to make the ElementList inline. So the
following should be used:
@ElementList(name="table", inline=true)
ArrayList <table> list;
This will ensure there is no enclosing <table>
representing the list object. Same goes for the
column. Hope this helps.
Niall
--- Wessam Abd Rabo <wes...@gm...> wrote:
> Hi,
> Am experiencing a problem on trying to use
> ElementList inside my code. Am
> trying to produce XML in the following format:
>
> <database name="Company">
>
> <table name="Employee">
> <column name="ssn" primary key="true"/>
> <column name="sname" />
> </table>
>
> <table name="Department">
> <column name="dcode" primary key="true"/>
> <column name="dname" />
> </table>
>
> </database>
>
>
> However the one produced looks as follows:
>
> <database name="Company">
> <table>
>
> <table name="Employee">
> <column>
> <column name="ssn" primary key="true"/>
> <column name="sname" />
> </column>
> </table>
>
> <table name="Department">
> <column>
> <column name="dcode" primary key="true"/>
> <column name="dname" />
> </column>
> </table>
>
> </table>
> </database>
>
> I think i have a problem with using ElementList. In
> my code, i declare class
> database in which i declare the following Arraylist
> to get the tables list:
>
> @ElementList(name="table")
> ArrayList <table> list;
>
> Class Table looks as follows:
>
> @Root(name="table")
>
> class table{
>
> @Attribute(name="name")
> private String name;
>
> @ElementList(name="Column")
> private ArrayList<Entry> list;
>
> ......}
>
> I declare inside table another arraylist for the
> columns. Class Column:
>
>
> @Root(name="column")
> public class column {
>
> @Attribute(name="name")
> private String name;
>
> @Attribute(name="primary key")
> private boolean value;
> ........}
>
> i'm not sure if the format i want can still be
> generated if i use
> elementlist in the same way.
>
> i need help with this
>
> Thanks in advance
>
> Wessam
> >
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2005.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/>
_______________________________________________
> Simple-support mailing list
> Sim...@li...
>
https://lists.sourceforge.net/lists/listinfo/simple-support
>
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
|