xml和web特殊字符

2019-12-25,,,,

复制代码 代码如下:
def covert_xml_special_char(convert_str):
'''''替换xml中的特殊字符'''
convert_str = convert_str.replace('&', '&')
convert_str = convert_str.replace('"''"', '"')
convert_str = convert_str.replace("'", ''')
convert_str = convert_str.replace('<', '<')
convert_str = convert_str.replace('>', '>')
return convert_str

《xml和web特殊字符.doc》

下载本文的Word格式文档,以方便收藏与打印。