ElementTree and XPATH

Martijn Faassen faassen at infrae.com
Sat Dec 11 15:54:01 CET 2004

Istvan Albert wrote:
> dayzman at hotmail.com wrote:
>> it seems to be invalid syntax if I give "/a/b[0]" to the findall()
>> method. Does anyone know the correct syntax?
> I think the proper mindset going in should be that
> elementtree does not support xpath but that
> there are some handy constructs that resemble
> the location steps of xpath.

The lxml Pythonic wrapper of libxml2 which aims (among others) to build 
an elementtree API compatible interface will indeed extend that API and 
offer XPath support. Of course it's all not done yet. :)




More information about the Python-list mailing list