[lxml-dev] lxml

Yassin Ezbakhe yassin at ezbakhe.es
Fri Jul 24 00:19:47 CEST 2009


Hi, I'm using Python 2.6.2 (Windows) and lxml 2.2.2.

When I run the following piece of code, it gets stuck.

import lxml.etree as et
s = "<root><a><b/><c/></a><d/><e/></root>"
xml = et.fromstring(s)
print xml[0] # prints element a
print xml[2] # prints element e
print xml[3] # it should raise an out of range exception, but it gets stuck

What is the problem? In the original ElementTree implementation, I get an
IndexError.

Thanks,
Yassin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20090724/63fe7d3d/attachment.htm 


More information about the lxml-dev mailing list