def parseChangeXML(raw_xml):
 data = dict()
 try:
  doc = xml.dom.minidom.parseString(raw_xml)
 except ExpatError:
  print('\nError: Got an empty response with an empty changeset.\n')
  raise
 log_entry = doc.getElementsByTagName('logentry')[0]
 data['revision'] = log_entry.getAttribute('revision')
 data['author'] = ''.join([t.data for t in log_entry.getElementsByTagName('author')[0].childNodes])
 data['comments'] = ''.join([t.data for t in log_entry.getElementsByTagName('msg')[0].childNodes])
 pathlist = log_entry.getElementsByTagName('paths')[0]
 paths = []
 for path in pathlist.getElementsByTagName('path'):
  paths.append(''.join([t.data for t in path.childNodes]))
 data['paths'] = paths
 return data

def parseChangeXML ( raw_xml ) : data = dict ( ) try : doc = xml . dom . minidom . parseString ( raw_xml ) except ExpatError : print ( '\nError: Got an empty response with an empty changeset.\n' ) raise log_entry = doc . getElementsByTagName ( 'logentry' ) [ 0 ] data [ 'revision' ] = log_entry . getAttribute ( 'revision' ) data [ 'author' ] = '' . join ( [ t . data for t in log_entry . getElementsByTagName ( 'author' ) [ 0 ] . childNodes ] ) data [ 'comments' ] = '' . join ( [ t . data for t in log_entry . getElementsByTagName ( 'msg' ) [ 0 ] . childNodes ] ) pathlist = log_entry . getElementsByTagName ( 'paths' ) [ 0 ] paths = [ ] for path in pathlist . getElementsByTagName ( 'path' ) : paths . append ( '' . join ( [ t . data for t in path . childNodes ] ) ) data [ 'paths' ] = paths return data
parse the raw xml and return a dict with key pairs set .