How to use the recurly.recurly.Recurly._parse_xml_doc function in recurly

To help you get started, we’ve selected a few recurly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github recurly / recurly-client-python / recurly / recurly.py View on Github external
    @staticmethod
    def xml_to_dict(xml):
        doc = minidom.parseString(xml)
        return Recurly._parse_xml_doc(doc.documentElement)
github recurly / recurly-client-python / recurly / recurly.py View on Github external
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