Removed JSON<->XML issue
Cannot be done automagically without some assumptions, so it is worth of doing the conversion by hand suited to our needs.
This commit is contained in:
parent
adc2305713
commit
e8a2fdb017
|
@ -24,6 +24,9 @@ def getLibrary(path):
|
|||
newbook['id'] = int(i.attrib['id'])
|
||||
# these `for` overwrite previous values,
|
||||
# but it is not an issue since actually these are one shot only elements
|
||||
# actually there is no 1to1 conversion between XML and JSON, so this operation
|
||||
# can not be made automagically without doing some preliminary assumptions
|
||||
# (Possibly useful module: https://github.com/martinblech/xmltodict)
|
||||
for j in i.iter('title'):
|
||||
newbook['title'] = j.text
|
||||
for j in i.iter('publisher'):
|
||||
|
|
Loading…
Reference in New Issue