This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CDATA

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for asking a dumb question! Why do we need CDATA in XML when we can use "& lt;" and "& rt;".
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a good question. We might manage without CDATA but I still think it's useful. Consider a large text block containing hundreds and hundreds of special characters you need to encode as an entity reference. Without CDATA, you would need to do a lot more string manipulation compared to using CDATA. With CDATA, you only need to encode the ]]> into [[>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic