[lxml-dev] ODS file with lxml

Piet van Oostrum piet at cs.uu.nl
Thu Jun 4 08:36:15 CEST 2009


>>>>> Ovnicraft <ovnicraft at gmail.com> (O) escribió:

>O> Hi folks, i am triying to manipulate the content.xml file from ODS in lxml
>O> but when i try: doc = etree.parse(xmldata), give me the content of xmldata
>O> in STDOUT, i guess it can be parsed.

>O> I attached the file what i ma using.

>O> Waiting your suggest,

etree.parse should be given a file object or filename as parameter. If
you want to use an xml string you should use
doc=etree.fromstring(xmldata)

See http://codespeak.net/lxml/parsing.html
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the lxml-dev mailing list