aspose file tools*
The moose likes XML and Related Technologies and the fly likes CDATA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "CDATA" Watch "CDATA" New topic
Author

CDATA

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Sorry for asking a dumb question! Why do we need CDATA in XML when we can use "& lt;" and "& rt;".


Groovy
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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 [[>


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CDATA