html in xml problem

Peter Hansen peter at
Thu Sep 26 08:38:09 EDT 2002

walter hoolwerf wrote:
> I need to place some HTML code in an XML file en process it with
> python.

The only relatively safe way to do something like this, and even then you can
get in trouble, is to use the <![CDATA["put all the nasty HTML here"]]>

The "nasty HTML" cannot contain the sequence ]]> but as long as you can
guarantee that, this should be safe for embedding HTML, or almost anything,
in XML.


More information about the Python-list mailing list