[XML-SIG] losing entities when parsing then texting

Mike Brown mike at skew.org
Sun Jul 3 19:56:22 CEST 2005

Greg Wilson wrote:
> Dieter Maurer wrote:
> > "Minidom"s support for entities is weak.
> > 
> > Try to avoid them (beside the standard XML entities) by
> > using the corresponding Unicode characters instead.
> I realize I should include the Unicode characters directly in my files,
> but that's not possible in this case---I have to accommodate people who
> are using editors that only handle 7-bit ASCII.

<?xml version="1.0" encoding="utf-8"?>
  <!ENTITY bullet "&#2022;">
  <!ENTITY eacute "&#233;">
<z>&bullet; &eacute;</z>

means exactly the same as

<?xml version="1.0" encoding="utf-8"?>
<z>&#2022; &#233;</z>

so why not just use the latter? No need for entities when you can
use numeric character references. Accommodating 7-bit editors is
basically what they exist for.


More information about the XML-SIG mailing list