posted 14 years ago
I have an ArrayList of ArrayLists, and want to write the data into a XML.
I wrote an obvious loop that attaches tags and prints out the XML contnet.
The problem is if a particular value has special characters, I know I have to use CDATA but then how do I do that selectively?
If all values are kept in CDATA (without checking whether or not they have chracters that need to be enclosed in CDATA) then is it a good practice OR should I check and add CDATA (which will be a costly if condition inside the loop) OR any other option exists?