def getXMLElementByKey(key, xmlElement):
 if (key not in xmlElement.attributeDictionary):
  return None
 word = str(xmlElement.attributeDictionary[key]).strip()
 evaluatedLinkValue = getEvaluatedLinkValue(word, xmlElement)
 if (evaluatedLinkValue.__class__.__name__ == 'XMLElement'):
  return evaluatedLinkValue
 print 'Warning, could not get XMLElement in getXMLElementByKey in evaluate for:'
 print key
 print evaluatedLinkValue
 print xmlElement
 return None

def getXMLElementByKey ( key , xmlElement ) : if ( key not in xmlElement . attributeDictionary ) : return None word = str ( xmlElement . attributeDictionary [ key ] ) . strip ( ) evaluatedLinkValue = getEvaluatedLinkValue ( word , xmlElement ) if ( evaluatedLinkValue . __class__ . __name__ == 'XMLElement' ) : return evaluatedLinkValue print 'Warning, could not get XMLElement in getXMLElementByKey in evaluate for:' print key print evaluatedLinkValue print xmlElement return None
get the xml element by key .