Difference between CDATA and PCDATA in XML ?

Answers were Sorted based on User's Feedback



Difference between CDATA and PCDATA in XML ?..

Answer / 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

Difference between CDATA and PCDATA in XML ?..

Answer / sridhar

PCDATA - Parsed Character Data means the XML Parser examins
the data whether the value/text contains entity or not if
it is then it will be replaced for example < should be
given as &lt;

Where as CDATA means The XML parser will not validate
value/text inside the CDATA tag. It is useful for passing
value/text directly to the required application as it is.

Is This Answer Correct ?    60 Yes 12 No

Post New Answer

More XML XSLT RSS Interview Questions

How do I convert excel to xml?

0 Answers  


What is rss service on my phone?

0 Answers  


What is Assync in XML api which version of XML parser u worked with ?

0 Answers   Satyam,


What software is needed to process xml namespaces?

0 Answers  


What is the difference between dtd and xml schema?

0 Answers  






What is xmlns in html?

0 Answers  


What are simple xml elements?

0 Answers  


Why xsl is used in xml?

0 Answers  


What is ?Well Formed XML? and ?Valid XML?

1 Answers  


What is the main disadvantage of dom?

0 Answers  


what is the significance of namespaces in xml?

1 Answers  


How do I create an xsl file for an xml file?

0 Answers  


Categories