Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

special character handling issue  RSS feed

 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build a xml. I am getting error when trying to build with a string which has “&” in it like(Apple & Orange). I would appreciate if someone can suggest me to solve this issue. Thanks...

My code is:



 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Try place the offending data, that is the string containing the & character, in a CDATA section.
For examples and more in-depth explanation, see http://www.w3schools.com/xml/xml_cdata.asp
Best wishes!
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!