html in xml problem

Peter Hansen peter at engcorp.com
Thu Sep 26 14:38:09 CEST 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"]]>
construct.

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.

-Peter



More information about the Python-list mailing list