Can't seem to remove "ns0:" namespace declaration [duplicate]
If the default namespace in the original input is http://www.sitemaps.org/schemas/sitemap/0.9
, as shown in:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
then if you set setting it to something else with
ET.register_namespace("", "http://www.w3.org/2000/svg")
you'll need some other namespace declared in the output for http://www.sitemaps.org/schemas/sitemap/0.9
. Instead, you should set it to the same value:
ET.register_namespace("", "http://www.sitemaps.org/schemas/sitemap/0.9")
(Alternatively, you might try simply not setting it to anything at all; perhaps the same namespaces would be used by default in the output that were present in the input.)