SleekXMPP/sleekxmpp/xmlstream/matcher/xpath.py

12 lines
234 B
Python
Raw Normal View History

2009-06-03 22:56:51 +00:00
from . import base
from xml.etree import cElementTree
class MatchXPath(base.MatcherBase):
def match(self, xml):
x = cElementTree.Element('x')
x.append(xml)
if x.find(self._criteria) is not None:
return True
return False