[Simple-support] Problem with using Element List
Brought to you by:
niallg
|
From: Wessam A. R. <wes...@gm...> - 2007-09-14 13:01:35
|
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
|