Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@staticmethod
def xml_to_dict(xml):
doc = minidom.parseString(xml)
return Recurly._parse_xml_doc(doc.documentElement)
if child.nodeType == minidom.Node.ELEMENT_NODE:
try:
di[child.tagName]
except KeyError:
# @todo This could be changed so that if the root type is an array,
# we automatically treat the resource as an array (eg. no checking
# the element name)
if child.tagName in MULTIPLE and root_type in ['array', 'collection']:
di[child.tagName] = []
elif child.tagName in FORCED_MULTIPLE:
di[child.tagName] = []
else:
di[child.tagName] = None
if di[child.tagName] is None:
di[child.tagName] = Recurly._parse_xml_doc(child)
elif type(di[child.tagName]) is types.ListType:
di[child.tagName].append(Recurly._parse_xml_doc(child))
child = child.nextSibling
return di