def decode()

in mns/mns_xml_handler.py [0:0]


    def decode(xml_data, req_id=None):
        subscriptionurl_list = []
        next_marker = ""
        if (xml_data != ""):
            try:
                root = ElementTree.fromstring(xml_data)
                namespace = root.tag[0:-13]
                subscriptions = list(root.iter(namespace + "Subscription"))
                for subscription in subscriptions:
                    for node in subscription:
                        nodeName = node.tag[len(namespace):]
                        nodeValue = node.text.strip()
                        if nodeName == "SubscriptionURL" and len(nodeValue) > 0:
                            subscriptionurl_list.append(nodeValue)
                marker = list(root.iter(namespace + "NextMarker"))
                for node in marker:
                    next_marker = node.text.strip()
            except Exception:
                raise MNSClientNetworkException("RespDataDamaged", xml_data, req_id)
        else:
            raise MNSClientNetworkException("RespDataDamaged", "Xml data is \"\"!", req_id)
        return subscriptionurl_list, str(next_marker)