On 26 Dec 2005 15:42:56 -0800, Gerard Flanagan <[EMAIL PROTECTED]> wrote: >Pseudo-XPath support for ElementTree with the emphasis on 'Pseudo'. > > http://gflanagan.net/site/python/pagliacci/ElementFilter.html > > [snip] > > ns = "xmlns1" > path = r"{%s}To/[EMAIL PROTECTED]'Mrs Jones' and @test==3]" % >(ns,ns)
How about promoting the query to a set of Python objects? eg, path = Query( ns.xmlns1.To / ns.xmlns1.mailto['name': 'Mrs Jones', 'test': '3']) That's just off the top of my head as an example of the kind of thing I mean. There is probably a better (more consistent, flexible, easier to read, etc) spelling possible. The advantages of this over strings is that you can break the query up into multiple pieces, pass parts of it around as real, live objects with introspectable APIs, allow for mutation of portions of the query, re-arrange it, etc. All this is possible with strings too, just way harder :) Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list