+local function _add_handler(module, origin_type, tag, xmlns, handler)
+ handlers[origin_type] = handlers[origin_type] or {};
+ if not handlers[origin_type][tag] then
+ handlers[origin_type][tag] = handlers[origin_type][tag] or {};
+ handlers[origin_type][tag][xmlns]= handler;
+ handler_info[handler] = module;
+ log("debug", "mod_%s now handles tag '%s'", module.name, tag);
+ elseif handler_info[handlers[origin_type][tag]] then
+ log("warning", "mod_%s wants to handle tag '%s' but mod_%s already handles that", module.name, tag, handler_info[handlers[origin_type][tag]].module.name);
+ end