This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
<data name="title"><![CDATA[Viva’s Strategy for Growths]></data>
When I open this XML I get error as Invalid character found this is due to single code which is not in proper format but I can not control that , String comes from DB...Hence I used CDATA which should solve my problem, but it is not.
I find it improbable that a single quote in XML causes any sort of problem; XML contains single quotes all the time. Are you sure the data wasn't cut-and-pasted from a word processing program that used some sort of smart quote rather than an actual apostrophe?
Joined: Oct 01, 2008
Yes, even I think the same thing. User might cut - pasted from somewhere, but now that data is in DB and I have to generate XML How to handle the such situations? Is there any alternatives to such problem?
If there is any chance of users cutting and pasting those ghastly MS word "smart" punctuation characters you need to protect the entire application by cleaning any input which may contain them. This is a well known problem.