[lxml-dev] filtering namespaces in findall
Hi, since I was rewriting the tree iterator anyway, I stumbled over the fact that ElementTree's getiterator() can filter for any tag ("*"), but not for any tag within a namespace ("{namespace}*"). Since this is just a cheap and straight forward little extension to the node filter (and a pretty nice feature to have), I added that to lxml and hope for inclusion in a future ElementTree version also (or maybe a hint why Fredrik assumes this to be inappropriate). Note that it's not currently supported in findall, though, as we use the same implementation as ElementTree there. Stefan
Hi all, Stefan Behnel wrote:
ElementTree's getiterator() can filter for any tag ("*"), but not for any tag within a namespace ("{namespace}*").
Note that it's not currently supported in findall, though, as we use the same implementation as ElementTree there.
Actually, it *does* work in findall. ET's _elementpath.py nicely passes the pattern on to getiterator(), so that lxml now supports it in getiterator() and the find*() methods. Stefan
participants (1)
-
Stefan Behnel