views:

355

answers:

3

Hi,

Is it possible to use XPath Query in Python while processing XML. I am using minidom which doesn't support that. Is there any other module for that?

A: 

This link may help

ccheneson
+2  A: 

My favorite XML processing library for Python is lxml which, because it is a wrapper around libxml2, also supports full XPath.

There is also 4Suite which is more of a pure Python solution.

Van Gale
+1  A: 

http://docs.python.org/library/xml.etree.elementtree.html

etree supports XPath queries, just like lxml.

etree is included in the standard library, but lxml is faster.

Gonsalu