Ampersands in XML (was: UTF-8 editing problems with GEdit)

Björn Persson listor1.rombobeorn at comhem.se
Wed Apr 28 01:32:47 UTC 2004


Paul M. Bucalo wrote:

> I believe the problem was the use
> one or more illegal character entries (like adding "&" to a title) and
> that was causing it to fail. I seem to recall that you need to precede
> each of these with an "\" to keep it from being interpreted, just like
> at a BASH console.

In XML and HTML (and I would guess all sorts of SGML), ampersand starts 
an entity reference (which ends with a semicolon). If you want a literal 
ampersand you must write it as "&", that is, an entity reference 
that references the ampersand entity. Likewise, if you want a less-than 
sign you can't write just "<", because that starts a tag, so you write 
it as "<".

Björn Persson





More information about the fedora-list mailing list