So I have an XML string that I want to convert to JSON in Python 3.2. I was going to do that by converting the string to a python object via lxml and then convert the object to JSON via JSONEncoder.
Unfortunately, lxml does not seem to be built for Win32, does anyone have any suggestions for an alternate XML – Python library or XML – JSON library?
xml.etree.ElementTree and its faster sibling xml.etree.cElementTree are included with all Python versions from 2.5 onwards. The Python 3.2 docs are here.
lxml.etree is an implementation of the ElementTree interface with some enhancements and (well-documented) minor differences. However the structure of an Element instance is the same. Is there any particular reason why you must have lxml?