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

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