def removeUnreferencedIDs(referencedIDs, identifiedElements):
 global numIDsRemoved
 keepTags = ['font']
 num = 0
 for id in identifiedElements.keys():
  node = identifiedElements[id]
  if ((referencedIDs.has_key(id) == False) and (not (node.nodeName in keepTags))):
   node.removeAttribute('id')
   numIDsRemoved += 1
   num += 1
 return num

def removeUnreferencedIDs ( referencedIDs , identifiedElements ) : global numIDsRemoved keepTags = [ 'font' ] num = 0 for id in identifiedElements . keys ( ) : node = identifiedElements [ id ] if ( ( referencedIDs . has_key ( id ) == False ) and ( not ( node . nodeName in keepTags ) ) ) : node . removeAttribute ( 'id' ) numIDsRemoved += 1 num += 1 return num
removes the unreferenced id attributes .