| Author |
CDATA
|
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
|
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
|
|
|
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]
|
 |
 |
|
|
subject: CDATA
|
|
|