-1
How can I generate an xml file in java, from a class that receives an Arraylist as attribute. I am not able to access the indexes of this Arraylist at the time of passing to the string that will be saved in xml.
-1
How can I generate an xml file in java, from a class that receives an Arraylist as attribute. I am not able to access the indexes of this Arraylist at the time of passing to the string that will be saved in xml.
0
I don’t know which lib you’re using to serialize objects in XML, but I usually use Xstream.
In case of serializing a list of products of an object Carrinho
which has a list of products:
XStream xstream = new XStream();
xstream.alias("Produtos", List.class);
xstream.toXML(carrinho.getProdutos());
Browser other questions tagged java xml
You are not signed in. Login or sign up in order to post.
Anything, send your code and I’ll take a look...
– Denis Neres