Why is the XML tag data inside this <! [CDATA []]>
4 answers
From Wikipedia
The CDATA section begins with the following sequence:
<![CDATA[
and ends with the first occurrence of the sequence:
]]>
All characters enclosed between these two sequences are interpreted as characters, not markup or entity references. For example, in a line like this:
<sender>John Smith</sender>
opening and closing sender tags are interpreted as markup. However, if it is written like this:
<![CDATA[<sender>John Smith</sender>]]>
then the code is interpreted in the same way as if it were written as follows:
<sender>John Smith</sender>
See the Wiki for more details .
+5
CDATA :
XML CDATA , , , .
, , <![CDATA[ ]]>.
, HTML XML. :
<root>
<myhtml>
<div><b>Foo bar</b></div>
</myhtml>
</root>
<div><b>Foo bar</b></div> DOM. , , DTD.
:
<root>
<myhtml>
<![CDATA[ <div><b>Foo bar</b></div> ]]>
</myhtml>
</root>
<div><b>Foo bar</b></div> node.
+3