ElementTree and Unicode

Sébastien Boisgérault Sebastien.Boisgerault at gmail.com
Wed Aug 2 11:31:11 EDT 2006


Richard Brodie wrote:
> "Sébastien Boisgérault" <Sebastien.Boisgerault at gmail.com> wrote in message
> news:1154530195.741884.34350 at h48g2000cwc.googlegroups.com...
>
> >>>> element = Element("string", value=u"\x00")
>
> I'm not as familiar with elementtree.ElementTree as I perhaps
> should be. However, you appear to be trying to insert a null
> character into an XML document. Should you succeed in this
> quest, the resulting document will be ill-formed, and any
> conforming parser will choke on it.

I am trying to embed an *arbitrary* (unicode) strings inside
an XML document. Of course I'd like to be able to reconstruct
it later from the xml document ... If the naive way to do it does
not work, can anyone suggest a way to do it ?

SB




More information about the Python-list mailing list