Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what actually is PCDATA and CDATA?

it seems that a loose definition of PCDATA and CDATA is that

  1. PCDATA is character data, but is to be parsed.
  2. CDATA is character data, and is not to be parsed.

but then someone told me that CDATA is actually parsed or PCDATA is actually not parsed... so it is a bit of a confusion. Does anyone know the real deal is?

Update: I actually added the PCDATA definition on Wikipedia... so don't take that answer too seriously as that's only my rough understanding of it.

like image 756
nonopolarity Avatar asked May 13 '09 13:05

nonopolarity


People also ask

What is CDATA and PCDATA?

CDATA means the element contains character data that is not supposed to be parsed by a parser. #PCDATA means that the element contains data that IS going to be parsed by a parser. The keyword ANY declares an element with any content. If a #PCDATA section contains elements, these elements must also be declared.

What does PCDATA mean in XML?

PCDATA. PCDATA means parsed character data. Think of character data as the text found between the start tag and the end tag of an XML element. PCDATA is text that WILL be parsed by a parser.

What is meant by CDATA?

The term CDATA, meaning character data, is used for distinct, but related, purposes in the markup languages SGML and XML. The term indicates that a certain portion of the document is general character data, rather than non-character data or character data with a more specific, limited structure.

What is CDATA block?

CDATA is defined as blocks of text that are not parsed by the parser, but are otherwise recognized as markup. The predefined entities such as <, >, and & require typing and are generally difficult to read in the markup. In such cases, CDATA section can be used.


1 Answers

From WIKI:

PCDATA

Simply speaking, PCDATA stands for Parsed Character Data. That means the characters are to be parsed by the XML, XHTML, or HTML parser. (&lt; will be changed to <, <p> will be taken to mean a paragraph tag, etc). Compare that with CDATA, where the characters are not to be parsed by the XML, XHTML, or HTML parser.

CDATA

The term CDATA, meaning character data, is used for distinct, but related purposes in the markup languages SGML and XML. The term indicates that a certain portion of the document is general character data, rather than non-character data or character data with a more specific, limited structure.

like image 168
Ólafur Waage Avatar answered Sep 29 '22 06:09

Ólafur Waage