diff --git a/TODO b/TODO index 8ec2c84..e69de29 100644 --- a/TODO +++ b/TODO @@ -1 +0,0 @@ -- Properly automagically read interesting parts of XML into JSON diff --git a/tcparser.py b/tcparser.py index 9e06a34..15c9d86 100644 --- a/tcparser.py +++ b/tcparser.py @@ -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'):