How to search XML? Are there special libs?

uche.ogbuji at gmail.com uche.ogbuji at gmail.com
Fri Mar 17 23:01:42 CET 2006


Ravi Teja wrote:
> Yes! XPath is a good bet.
> You can also try some Pythonic XML libraries like Amara. You need not
> learn any special language even.
>
> There are good database approaches to XML too, especially if you are
> going to query a document collection as a whole rather than file by
> file. You can try XQuery. I think 4Suite can do this (But I am too
> sleepy to confirm :-) ). You also use eXist (Java but you can use
> XMLRPC or SOAP to interface with it from Python). Not optimal like
> parent said, but if it is XML that have to live with ...

4Suite does not support XQuery.  It does support full XPath plus EXSLT
and enough other extensions to come close to the power of XQuery.
Amara [1] makes it really easy to get XQuery-like power from right
within Python, as I've blogged before (e.g. [2][3]).

I don't know whether full-text indexing of XML is something the OP
needs as well.  If so, see [3].

[1] http://uche.ogbuji.net/tech/4Suite/amara/
[2] http://copia.ogbuji.net/blog/2005-06-12/Amara_equi
[3] http://copia.ogbuji.net/blog/2005/Sep/20
[4] http://www.xml.com/pub/a/2004/12/08/py-xml.html

--
Uche Ogbuji                               Fourthought, Inc.
http://uche.ogbuji.net                    http://fourthought.com
http://copia.ogbuji.net                   http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/




More information about the Python-list mailing list