etree.parse() se to nelíbí .. TypeError: Parse() argument 1 must be string or read-only buffer, not instance
Já potřebuju xml data dostat do stringu, ne ze stringu ... -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jan Martinek Sent: Monday, September 17, 2007 12:09 PM To: Konference PyCZ Subject: Re: [python] XML a XSLT transformace & Python Martin Stiborský wrote: > Díky za nakopnutí k StringIO. Už mi to funguje. > Je ten stringIO potřeba? Nešlo by to nějak takhle? >>> from xml.etree.ElementTree import * >>> text = '<xml ble="bla"> NECO </xml>' >>> e = XML(text) >>> e.text ' NECO ' >>> e.tag 'xml' >>> e.attrib {'ble': 'bla'} >>> Použil jsem funkci XML(), což je totéž co fromstring(): >>> XML is fromstring True -- Jan Martinek _______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python _______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python
