CDATA

acronym

web devprogramming

Stands for: character data (XML)

An XML section whose content is not parsed as markup.

A character data section lets an XML document include raw text - like code or markup - without the parser interpreting angle brackets and ampersands. It is written as a CDATA block so special characters need no escaping.

A CDATA section tells an XML parser to treat its content as literal characters rather than markup, which is how a document embeds a fragment containing angle brackets without escaping every one.

It is a formatting convenience with a security edge. Filters and validators that scan XML for dangerous content sometimes fail to inspect inside CDATA, so a payload placed there can pass a check that would have caught it elsewhere. The rule that follows is the general one for parsing: validation must happen after the document is fully parsed into its logical structure, not against its serialized text, because the text form has more than one way to say the same thing.

Also known as: cdata

All glossary entries