I wouldlike to remove some character when I try to convert my xml to dict :
data = xmltodict.parse(open('test.xml').read())
with open('test2.json', "wt", encoding='utf-8', errors='ignore') as f:
json.dump(data, f, indent=4, sort_keys=True)
return data
The problem actually i have many json file some json file like this :
{
"pcrs:test A": {
"pcrs:nature": "03",
"pcrs:producteur": "SIEML"
}}
And some json file like this(without pcrs) :
{
"test B": {
"nature": "03",
"producteur": "SIEML",
}}
How to force any file like the first example to be without 'pcrs:'
as the seconde example.