I'm using ElementTree to parse a simple string of xml:
<string xmlns="http://ift.tt/JiuCsN">maison</string>
That's the root. All I want is the contents of that tag, to convert into json. 'translation' is the xml text.
tree = ET.ElementTree(translation)
root = tree.getroot()
return root.text
It looks simple enough but it's throwing the " Object has no attribute 'text' " error. What am I doing wrong?
No comments:
Post a Comment