def getElementNodeByKey(elementNode, key):
 if (key not in elementNode.attributes):
  return None
 word = str(elementNode.attributes[key]).strip()
 evaluatedLinkValue = getEvaluatedLinkValue(elementNode, word)
 if (evaluatedLinkValue.__class__.__name__ == 'ElementNode'):
  return evaluatedLinkValue
 print 'Warning, could not get ElementNode in getElementNodeByKey in evaluate for:'
 print key
 print evaluatedLinkValue
 print elementNode
 return None

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