X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fruntime.py;h=f9263fb1261cb5b621505ac95770b00d45c3066b;hb=a7a01a6a19f91fccb0bda1c60454ebe2cc848d2d;hp=0c6b8b1ca6340b9a26865ba13d0d55d595df6c2b;hpb=94cfe1693332964c414a9dff1756150fe8d47839;p=sfa.git diff --git a/sfatables/runtime.py b/sfatables/runtime.py index 0c6b8b1c..f9263fb1 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -50,12 +50,14 @@ class SFATablesRules: childNode = self.create_xml_node(k, context_dict[k]) node.addChild(childNode) else: - node.addContent(context_dict[k]) + childNode = libxml2.newNode(k) + childNode.addContent(context_dict[k]) + node.addChild(childNode) return node def add_request_context_to_rspec(self, doc): p = doc.xpathNewContext() - context = p.xpathEval("//rspec") + context = p.xpathEval("//RSpec") if (not context): raise Exception('Request is not an rspec') else: @@ -74,8 +76,8 @@ class SFATablesRules: intermediate_rspec = doc for rule in self.sorted_rule_list: - intermediate_rspec = rule.apply_interpreted(intermediate_rspec) - if (rule.terminal): + (matched,intermediate_rspec) = rule.apply_interpreted(intermediate_rspec) + if (rule.terminal and matched): break final_rspec = self.wrap_up(intermediate_rspec)