def handleXMLContentFromMessage(content):
rootNode = None
if len(content) < 5:
print ('It is not valid xml content:' + str(content))
return rootNode
else:
if content[0:5] != '<msg>':
content = '\n'.join(content.split('\n',2)[1:])
try:
rootNode = ET.fromstring(content)
except ET.ParseError as args:
#print ('It is not valid xml content (' , args,'):\n',content)
rootNode = None
return rootNode
评论列表
文章目录