summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/matcher
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/xmlstream/matcher')
-rw-r--r--sleekxmpp/xmlstream/matcher/xmlmask.py3
-rw-r--r--sleekxmpp/xmlstream/matcher/xpath.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/matcher/xmlmask.py b/sleekxmpp/xmlstream/matcher/xmlmask.py
index 1cd19644..e4a22faa 100644
--- a/sleekxmpp/xmlstream/matcher/xmlmask.py
+++ b/sleekxmpp/xmlstream/matcher/xmlmask.py
@@ -16,7 +16,8 @@ class MatchXMLMask(base.MatcherBase):
self.default_ns = ns
def match(self, xml):
- xml = xml.xml
+ if hasattr(xml, 'xml'):
+ xml = xml.xml
return self.maskcmp(xml, self._criteria, True)
def maskcmp(self, source, maskobj, use_ns=False, default_ns='__no_ns__'):
diff --git a/sleekxmpp/xmlstream/matcher/xpath.py b/sleekxmpp/xmlstream/matcher/xpath.py
index 5e0411ef..fe18a655 100644
--- a/sleekxmpp/xmlstream/matcher/xpath.py
+++ b/sleekxmpp/xmlstream/matcher/xpath.py
@@ -6,7 +6,8 @@ ignore_ns = False
class MatchXPath(base.MatcherBase):
def match(self, xml):
- xml = xml.xml
+ if hasattr(xml, 'xml'):
+ xml = xml.xml
x = cElementTree.Element('x')
x.append(xml)
if not ignore_ns: