def for_each_param(node, callback):
    assert ((node.tag == 'memberdef') and (node.attrib.get('kind') == 'function'))
    plist = node.find("./detaileddescription/para/parameterlist[@kind='param']")

    def get_direct_text(n, tag):
        c = n.find(('./%s' % tag))
        if (c is not None):
            return ' '.join(c.itertext()).strip()
    for param in node.findall('./param'):
        (name, ptyp, desc) = (None, None, None)
        name = get_direct_text(param, 'declname')
        ptyp = get_direct_text(param, 'type')
        if (name and (plist is not None)):
            for plist_item in plist.findall('parameteritem'):
                if (plist_item.find(("./parameternamelist/[parametername='%s']" % name)) is not None):
                    pdesc_node = plist_item.find('./parameterdescription')
                    if (pdesc_node is not None):
                        desc = ' '.join(pdesc_node.itertext()).strip()
        callback(name, ptyp, desc)
def for_each_param(node, callback):
    assert ((node.tag == 'memberdef') and (node.attrib.get('kind') == 'function'))
    plist = node.find("./detaileddescription/para/parameterlist[@kind='param']")

    def get_direct_text(n, tag):
        c = n.find(('./%s' % tag))
        if (c is not None):
            return ' '.join(c.itertext()).strip()
    for param in node.findall('./param'):
        (name, ptyp, desc) = (None, None, None)
        name = get_direct_text(param, 'declname')
        ptyp = get_direct_text(param, 'type')
        if (name and (plist is not None)):
            for plist_item in plist.findall('parameteritem'):
                if (plist_item.find(("./parameternamelist/[parametername='%s']" % name)) is not None):
                    pdesc_node = plist_item.find('./parameterdescription')
                    if (pdesc_node is not None):
                        desc = ' '.join(pdesc_node.itertext()).strip()
        callback(name, ptyp, desc)