def element_like(self, element): """Compare a given variable to the element's content using SQL's 'LIKE' operator, not including leading and trailing whitespace. This is case-insensitive, and includes the '%' wildcard which may be placed at the beginning or end of the string. """ return "(%s LIKE %s)" % (self.varLookup(element.getAttributeNS(None, 'var')), quote(XML.shallowText(element).strip(), 'varchar'))
def element_match(self, element): """Compare a given variable exactly to the element's content, not including leading and trailing whitespace. """ return "(%s = %s)" % (self.varLookup(element.getAttributeNS(None, 'var')), quote(XML.shallowText(element).strip(), 'varchar'))