X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fxmlrule.py;h=ff3b3ef02f8a314e7cc93f5115b59fcadc737b4c;hb=31cc4fa991896f000abb106916662923f37bc3a6;hp=46f360185153c8703a6a7664fbe501377e781d65;hpb=57b6a99255d4a88be9c0f910f8524677e34ff4bc;p=sfa.git diff --git a/sfatables/xmlrule.py b/sfatables/xmlrule.py index 46f36018..ff3b3ef0 100644 --- a/sfatables/xmlrule.py +++ b/sfatables/xmlrule.py @@ -61,8 +61,8 @@ class XMLRule: def add_rule_context_to_rspec(self, doc): p = doc.xpathNewContext() - context = p.xpathEval("//RSpec") - if (not context): + context = p.xpathEval("//*") + if not context or context[0].name not in ['RSpec', 'rspec']: raise Exception('Request is not an rspec') else: # Add the request context