SOT : & in XML-documents

Henrik Motakef henrik.motakef at web.de
Tue Oct 8 16:10:43 EDT 2002


"Thomas Weholt" <2002 at weholt.org> writes:

> Damn!! The original data is filled with it. My solution so far has been to
> keep a list ( limited to '&' so far ) of characters to replace ( '&' is
> replaced with 'and' etc. ).

Not necessarily a good idea - there is a reason for & having to be
escaped: It is used in entity references like  , you probably
wouldn't like to convert all non-breaking space characters to
"andnbsp;"...

> Are there any other characters I must avoid/replace?

The character '<' has to be written as <. 

Regards
Henrik



More information about the Python-list mailing list