Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

PCDATA - parsed character data whicewhich means the data entered will be parsed by the parser.

CDATA - the data entered between CDATA elements will not be parsed by the parser.that is the text inside the cdataCDATA section will be ignored by the parser. as a result a malicious user can sent destroying data to the application using these cdataCDATA elements.

cdataCDATA section starts with "<![cdata[" and<![CDATA[ and ends with "]]>" ]]>.

The only string that cannotcannot occur in cdata is ]]>CDATA is ]]>.

The only reason why we use cdataCDATA is: text like javascriptJavascript code contains lot of <<, & characters. To avoid errors, script code can be defined as cdataCDATA, because using << alone will generate an error, as parser interprets it as the start of new element. similarly &Similarly & can be interpreted as a start of the charatercharacter entity by the parser.

PCDATA - parsed character data whice means the data entered will be parsed by the parser.

CDATA - the data entered between CDATA elements will not be parsed by the parser.that is the text inside the cdata section will be ignored by the parser. as a result a malicious user can sent destroying data to the application using these cdata elements.

cdata section starts with "<![cdata[" and ends with "]]>" .

The only string that cannot occur in cdata is ]]> .

The only reason why we use cdata is: text like javascript code contains lot of <, & characters. To avoid errors, script code can be defined as cdata, because using < alone will generate an error, as parser interprets it as the start of new element. similarly & can be interpreted as a start of the charater entity by the parser.

PCDATA - parsed character data which means the data entered will be parsed by the parser.

CDATA - the data entered between CDATA elements will not be parsed by the parser.that is the text inside the CDATA section will be ignored by the parser. as a result a malicious user can sent destroying data to the application using these CDATA elements.

CDATA section starts with <![CDATA[ and ends with ]]>.

The only string that cannot occur in CDATA is ]]>.

The only reason why we use CDATA is: text like Javascript code contains lot of <, & characters. To avoid errors, script code can be defined as CDATA, because using < alone will generate an error, as parser interprets it as the start of new element. Similarly & can be interpreted as a start of the character entity by the parser.

Source Link
Madhan
  • 2.6k
  • 7
  • 27
  • 22

PCDATA - parsed character data whice means the data entered will be parsed by the parser.

CDATA - the data entered between CDATA elements will not be parsed by the parser.that is the text inside the cdata section will be ignored by the parser. as a result a malicious user can sent destroying data to the application using these cdata elements.

cdata section starts with "<![cdata[" and ends with "]]>" .

The only string that cannot occur in cdata is ]]> .

The only reason why we use cdata is: text like javascript code contains lot of <, & characters. To avoid errors, script code can be defined as cdata, because using < alone will generate an error, as parser interprets it as the start of new element. similarly & can be interpreted as a start of the charater entity by the parser.