Reading XML namespaces

Martin v. Loewis martin at v.loewis.de
Sat May 15 17:37:10 EDT 2010


> BTW, I'm still not sure I understand your problem. Could you provide
> some more details?
>

Wouldn't it be easier if you told the OP how to access the prefix
mappings in lxml etree, or, if this was actually not possible, admitted
that it is actually not possible?

FWIW, in the DOM, you look at all attributes of an element node, and
search for those whose namespace is "http://www.w3.org/2000/xmlns/"

In SAX, you watch the startPrefixMapping events.

Regards,
Martin



More information about the Python-list mailing list