XML CDATA
Syntax
<![CDATA[text content possibly containing literal <or &characters ]]>
CDATA sections can be used to “block escape” literal text when replacing prohibited characters with entity references is undesirable. CDATA sections can appear inside element content and allow < and & character literals to appear. A CDATA section begins with the character sequence <![CDATA[ and ends with the character sequence ]]>. Between the two character sequences, an XML processor ignores all markup characters such as <, >, and &. The only markup an XML pro-cessor recognizes inside a CDATA section is the closing character sequence ]>. The character sequence that ends a CDATA section ]]> must not appear inside the element content. Instead, the closing greater-than character must be escaped using the appropriate entity >. CDATA sections cannot be nested.
Example of CDATA sections
<sometext>
<![CDATA[ They're saying "x < y" & that "z > y" so I guess that means that z > x ]]>
</sometext>
For all CDATA, the character literals which are prohibited, are not characters which are not literals and since they are not, it causes problems for exporting data in the form of other datasets like executing Processing Instructions.
Example of Built-in entity in element content
<sayhello word=''Hi'' />
Use of the built-in entity ' inside attribute content.
Previous:
XML prohibited character literals
Next:
XML declarations
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/xml/CDATA-sections.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics