Ampersands in XML

A word of warning:

Some XML parsers won't be stopped by the ampersand (&) symbol, others, I found, so for example Firefox, do have a problem with that.

You might find an instance were the XML parser stops when it encounters and untranslated ampersand. What happens is that these XML parsers expect to see the HTML number code written after an ampersand.

For the complete reference see here: http://www.ascii.cl/htmlcodes.htm

So for example, it's not good to have:
<name>Peter & Paul<name>


But better:
<name>Coolibert &#38; Jonathan<name>

And it is obviously better to have Coolibert and Jonathan, cause Peter and Paul just don't cut it.

Labels: , ,