Hej,
Potrzebuję pomocy z konwersją pliku xml do json'a według treści (Interpretowane z pliku XML maja być tylko pola opisane następującymi słowami kluczowymi: object, obj_name, field, name, type, value.) Czy ktoś poratuje ? :) Kod poniżej
from xmljson import badgerfish as bf
from xml.etree.ElementTree import fromstring
import json
import glob
for file in glob.glob('input.xml'):
name = str.split(file, "input")[-2]
with open(file, "r") as input:
jsonOut = bf.data(fromstring(input.read()))
with open(name + "result.json","w+") as newFile:
json.dump(jsonOut, newFile, ensure_ascii=False)```