On Tue, Dec 20, 2005 at 07:33:29PM +0100, Werner F. Bruhin wrote:
> I would like to embed an image in an XML file.
> 
> I was thinking of using PIL.tostring() and put it into the imageasstring 
> element.
> 
> <imagedata>
>     <imagemode>RGB</imagemode>
>     <imagesize>(540, 982)</imagesize>
>     <imageasstring>HERE GOES IMAGE DATA</imageasstring>
> </imagedata>
> 
> Currently I use lxml.etree and get encoding errors when I write the 
> image into the element.
> 
> I would like the file to XML Schema complient, so what "xs:" type should 
> one use for the imageasstring element?

You'll need to encode the imagestring data to base64, and use the
appropriate type.  

-- 
Alexandre Fayolle                              LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Retrait du projet de loi DADVSI: http://eucd.info/petitions/index.php?petition=2
Signez cette pétition, et faites-la circuler autour de vous, avant le 20 
décembre

Attachment: signature.asc
Description: Digital signature

_______________________________________________
XML-SIG maillist  -  XML-SIG@python.org
http://mail.python.org/mailman/listinfo/xml-sig

Reply via email to