def getparamssetattrs(dom, param_names, target):
    ''' XML helper to get <param name="name" value="value"/> tags and set
    the attribute in the target object. String type is used. Target object
    attribute is unchanged if the XML attribute is not present.
    '''
    params = dom.getElementsByTagName("param")
    for param in params:
        param_name = param.getAttribute("name")
        value = param.getAttribute("value")
        if value is None:
            continue # never reached?
        if param_name in param_names:
            setattr(target, param_name, str(value))
dataset/ETHPy150Open coreemu/core/daemon/core/misc/xmlutils.py/getparamssetattrs/original