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