示例#1
0
 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'))
示例#2
0
 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'))