Difference between CDATA and PCDATA in XML ?
Answers were Sorted based on User's Feedback
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 |
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 <
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 |
What compiler switch creates an xml file from the xml comments in the files in an assembly?
What is schemalocation in xml?
What is a schema in word?
What is difference between xsd and dtd?
2 Answers Accenture, Penta Pearl,
What is xml and its uses?
What is the XSLT?
How do I undeclare an xml namespace prefix?
What do you mean by xslt <xsl: choose> element?
How do I create an rss feed?
Define element and attribute in an xml document.
Where do I get an rss feed?
What is XmlReader class? Explain.