Difference between CDATA and PCDATA in XML ?

Answer Posted / sundaram

PCDATA – parsed character data. It parse/navigates to all
the data/text in an xml document.
Eg:
<name>
<first>prem</first>
<last>kumar</last>
</name>
Here, the name element contains 2 more
elements “first”,”last”. So it parse further to get the
data/text of first and last to give the value of name
as “premkumar”

CDATA – unparsed characted Data. This is the data that
should not be parsed further in an xml document.
<name>
<![CDATA[
<first>prem</first>
<last>kumar</last>
]]>
</name>
Here, the value of name will be
<first>prem</first><last>kumar</last>.

Thanks
sundaram80@rediffmail.com

Is This Answer Correct ?    80 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I (and my authors) still use client-side inclusions?

515


How do I convert xml to pdf?

466


What is an xml node?

504


What is cdata section in xml?

458


How do I create an xml map in excel?

446






What is xml and its benefits?

435


Describe xpath.

491


Can word open xml files?

464


How do I subscribe to an rss feed on my iphone?

477


Why namespace is used in xml?

489


How do I run an xsl file in eclipse?

473


How can I declare xml namespaces so that all elements and attributes are in their scope?

483


What is axml file?

478


Do rss feeds help seo?

447


What is the use of xslt element?

514