[lxml-dev] iterparse and namespaces

Stefan Behnel stefan_ml at behnel.de
Tue Mar 17 16:12:27 CET 2009


Piotr Furman wrote:
>  <jholg <at> gmx.de> writes:
>> Is there a usecase for "give me every element x from whatever
>> namespace"?
>
> Thanks for answer, my use case is that I have a xml file with only one
> namespace
> defined in root. I guess that if there were more namespaces in one file it
> wouldn't make sense, but as long as it's only one I just don't care about
> that and would have all specified elements.

uh? Then I really don't get it. If there is only one namespace that
contains all elements, then why can't you just look for the tags in
exactly that namespace? That will give you all tags with that name.

Stefan



More information about the lxml-dev mailing list