xmltodict icon indicating copy to clipboard operation
xmltodict copied to clipboard

Wildcard to process all namespaces to None or ''

Open ToddG opened this issue 5 years ago • 2 comments

I'd like to all namepaces, present or not, to be blanked.

e.g.

xmlns:ns1
xmlns:ns2

<ns1:bar> -> bar
<ns2:foo> -> foo
<foo> -> foo

But I don't know all the xml namespaces that might crop up in these docs, so I just want them all to be blanked.

namespaces = { ... "*" : None, # skip all namespaces ... }

ToddG avatar Sep 18 '19 21:09 ToddG

Alternatively, it'd be great to just have all the namespace stuff stripped out. Set process_namespaces=False, and then add a flag to strip_namespace=True so that...

<ns1:bar> -> bar
<ns2:foo> -> foo

ToddG avatar Sep 18 '19 21:09 ToddG

https://github.com/martinblech/xmltodict/pull/224

ToddG avatar Sep 19 '19 18:09 ToddG