enter code hereI've to deserialize this XML:
<rows profile="color">
<head>
<columns>
<column width="0" align="left" type="ro" sort="str" color=""><![CDATA[#]]></column>
<column width="80" align="left" type="ro" sort="str" color=""><![CDATA[Targa]]></column>
<column width="100" align="left" type="ro" sort="str" color=""><![CDATA[Telaio]]></column>
<column width="150" align="left" type="ro" sort="str" color=""><![CDATA[Tipo]]></column>
<column width="70" align="left" type="ro" sort="str" color=""><![CDATA[Archivio]]></column>
<column width="220" align="left" type="co" sort="str" color=""><![CDATA[Commenti]]><option value="A">A</option><option value="B">B</option><option value="C">C</option></column>
<column width="180" align="left" type="ed" sort="str" color=""><![CDATA[Destinatario]]></column>
</columns>
</head>
<row>
<cell><![CDATA[775]]></cell>
<cell><![CDATA[AA000AA]]></cell>
<cell><![CDATA[RTGGSHHJSJSNN]]></cell>
<cell><![CDATA[CDP]]></cell>
<cell><![CDATA[18]]></cell>
<cell><![CDATA[...]]></cell>
<cell><![CDATA[Â ]]></cell>
</row>
</rows>
But I haven't a defined class, how can I do it? I would use xstream library, but I don't know how use it.
EDIT:
But if I want to create a destination class, how I create it? I should have something like:
public class Rows {
private Head head;
private Row[] row;
}
public class Head {
private Columns columns;
}
public class Columns {
private Column column; // How can I get attributes?
}
public class Row {
private String [] cell;
}
and how can I use xstream after?
Rows,Head,Celletc.)? What type of object do you want the deserialization to return?