def decode()

in mns/mns_xml_handler.py [0:0]


    def decode(xml_data, with_meta, req_id=None):
        topicurl_list = []
        topicmeta_list = []
        next_marker = ""
        if (xml_data != ""):
            try:
                root = ElementTree.fromstring(xml_data)
                namespace = root.tag[0:-6]
                topics = list(root.iter(namespace + "Topic"))
                for topic in topics:
                    topicMeta = {}
                    for node in topic:
                        nodeName = node.tag[len(namespace):]
                        nodeValue = node.text.strip()
                        if nodeName == "TopicURL" and len(nodeValue) > 0:
                            topicurl_list.append(nodeValue)
                        if len(nodeValue) > 0:
                            topicMeta[nodeName] = nodeValue
                    if with_meta:
                        topicmeta_list.append(topicMeta)

                marker = list(root.iter(namespace + "NextMarker"))
                for node in marker:
                    next_marker = node.text.strip()
            except Exception as err:
                raise MNSClientNetworkException("RespDataDamaged", xml_data, req_id)
        else:
            raise MNSClientNetworkException("RespDataDamaged", "Xml data is \"\"!", req_id)
        return topicurl_list, str(next_marker), topicmeta_list