Ejemplo n.º 1
0
def getInfosFromXML(content):
    c = base64.b64decode(content)
    r = {'guids': {}, 'totalguids': 0}

    xml = ET.fromstring(c)
    openiocparser.removeNS(xml)

    for indic in xml.iter('IndicatorItem'):
        guid = indic.attrib['id']

        context = indic.findall('Context')[0]
        search = context.attrib['search']

        content = indic.findall('Content')[0]
        value = content.text

        r['guids'][guid] = {'search': search, 'value': value}
        r['totalguids'] += 1

    return r
Ejemplo n.º 2
0
def getInfosFromXML(content):

    c = base64.b64decode(content)
    r = {'guids':{}, 'totalguids':0}

    xml = ET.fromstring(c)
    openiocparser.removeNS(xml)
    
    for indic in xml.iter('IndicatorItem'):
    
        guid = indic.attrib['id']

        context = indic.findall('Context')[0]
        search = context.attrib['search']
        
        content = indic.findall('Content')[0]
        value = content.text
        
        r['guids'][guid] = {'search':search, 'value':value}
        r['totalguids']+=1
    
    return r