+ p = xmldoc.xpathNewContext()
+
+ supplied_arguments = match_options.arguments
+ for option in supplied_arguments:
+ option_name = option['name']
+ option_value = getattr(match_options,option_name)
+
+ if (hasattr(match_options,option_name)):
+ context = p.xpathEval("//rule/argument[name='%s']"%option_name)
+ if (not context):
+ raise Exception('Unknown option %s for match %s'%(option,option['name']))
+ else:
+ # Add the value of option
+ valueNode = libxml2.newNode('value')
+ valueNode.addContent(option_value)
+ context[0].addChild(valueNode)