Quantcast
Channel: When parsing Atom XML feeds, how should conflicting CDATA and entity escaped elements be handled? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Quentin for When parsing Atom XML feeds, how should conflicting CDATA and entity escaped elements be handled?

$
0
0

Content between CDATA markers is not parsed for entities of tags, so the parsed value of the text node is Johnson & Johnson.

Note that the attribute says type="html", so it should then be parsed as HTML.

e.g. If you were expressing this as a webpage you might write:

<h1>Johnson &amp; Johnson</h1>

If it had said type="text" then you would have needed to encode the plain text as HTML which would have given you:

<h1>Johnson &amp;amp; Johnson</h1>

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>