If we have the following XML element:
<x>a < b</x>
and the another one
<y>a<![CDATA[ < ]]>b</y>
Do both elements x
and y
have the value of a < b
? Is the second example valid, common, recommended or something like that?
AFAK y
has three child elements - PCDATA a
, CDATA <
and PCDATA b
and some libraries parse it exactly like that. On the other hand https://pugixml.org/ for one returns only a
as value for x
(helper function).