Is there any solution for adding namespaces without a prefix (I mean these ns0, ns1) that work in all etree implementations or are there working solutions for each of them?
Now I have solutions for:
- lxml - element nsmap argument
- (c) ElementTree (python 2.6+) - register a namespace method with an empty string as a prefix
The problem is (c) ElementTree in python 2.5, I know that there is an _namespace_map attribute, but setting it to an empty string creating invalid XML, setting it to None, adding the default ns0 namespace, etc., is there any Any working solution?
I think
Element('foo', {'xmlns': 'http://my_namespace_url.org/my_ns'})
- bad idea?
thanks for the help