Hi
Can any one tell me what is the use of CDATA in xml......................?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 10, 2011, 4:18 AM
http://en.wikipedia.org/wiki/CDATA
Zoran HorvatPosted Aug 10, 2011, 4:06 AM
http://www.w3schools.com/xml/xml_cdata.asp
Smart LuckyPosted Aug 10, 2011, 4:02 AM
can you send me an example please...?
Zoran HorvatPosted Aug 10, 2011, 3:53 AM
CDATA is used to transfer bulk data as part of XML document - for example, base64-encoded JPEG image and similar data. In such cases XML is normally formed, like having image name, dimensions and other properly formatted data as elements and attributes. And once things come to actually adding the image into XML, you just open CDATA block and pour the data into it.
Hope this explains. Only one more addition - text contained in CDATA should not be HTML encoded, since it is not treated by XML parser and consequently will not be decoded. It means that you're free to write <, > and other characters in CDATA. You can use it to contain raw HTML or XML if you like - it will all be ignored by the parser all until ]]> is reached.
Zoran
VulpesPosted Aug 10, 2011, 3:51 AM