if you know that nothing else is going to be in that xml, array is of strings or something else that can be represented as strings, and that the receiver will be able to parse that xml you can just do:
FileOutputStream fout = new FileOutputStream("bilbo.xml");
fout.println("<array>");
for(int i=0; i<array.size(); i++)
{
fout.println("><element>"+array[i]+"</element>");
}
fout.println("</array>");
Message was edited by:
ethical_anarhist
my array is made of java beans
the java bean is called PageContent, it is made of
*media_vasp
*media_id
*media_name
*media_price
*media_size
*media_URL
i want to return this array in an xml file by the means of a servlet
meaning that i want to return the xml in the http response of the servlet.
Knowing what you want to have in XML and how to access DOC components is a good beginning. Having xsd is definitely helpful.
It sounds however that you may be a bit away from that, with bean you can query them and get their content and attribute values. There are number of paths to go from here, for nice exposition see:
http://builder.com.com/5100-6371_14-1044810.html?tag=search
Pete_j
Message was edited by:
Pete_j