def params_file_csvtoxml(csv_name, input_type='map', xml_name='params_spec.xml'
    ):
    """
    参数文件若为csv格式需要转化成xml
    :param csv_name: csv文件的路径
    :param input_type: 测试数据的类型，构成xml文件必要的参数
    :param xml_name: xml文件的文件名，默认值
    :return:
    """
    import pandas as pd
    df = pd.read_csv(csv_name)
    df = df.fillna('')
    header = "<?xml version='1.0' encoding='utf-8'?><params>"
    bottom = '</params>'
    inparams_begin = '<inparams type="%s">' % input_type
    inparams_end = '</inparams>'
    outparams_begin = '<outparams type="%s">' % input_type
    outparams_end = '</outparams>'
    inparam_template = (
        '<inparam><name>%s</name><dName>%s</dName><type>%s</type><defaultValue>%s</defaultValue><datatype>%s</datatype><description>%s</description></inparam>'
        )
    outparam_template = (
        '<outparam><name>%s</name><dName>%s</dName><datatype>%s</datatype><description>%s</description></outparam>'
        )
    inparam = ''
    outparam = ''
    colums = []
    for c in df.columns:
        colums.append(c.lower())
    df.columns = colums
    for index, row in df.iterrows():
        if row['params_type'] == 'input':
            inparam += inparam_template % (row['name'], row['dname'], row[
                'type'], row['defaultvalue'], row['datatype'], row[
                'description'])
        else:
            outparam += outparam_template % (row['name'], row['dname'], row
                ['datatype'], row['description'])
    params_spec = (header + inparams_begin + inparam + inparams_end +
        outparams_begin + outparam + outparams_end + bottom)
    with open(xml_name, 'w') as f:
        f.write(params_spec)
