X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfatables%2Fxmlrule.py;h=ff3b3ef02f8a314e7cc93f5115b59fcadc737b4c;hp=46f360185153c8703a6a7664fbe501377e781d65;hb=e8d18d70468b223f3e0f46fa7941e062f0477aa8;hpb=9b91992f38e1f074845c75b29c107737fef5c6bc 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