+ curr_ns,name = name:match("^(.+)|([%w%-]+)$");
+ if curr_ns ~= "jabber:server" then
+ attr.xmlns = curr_ns;
+ end
+
+ -- FIXME !!!!!
+ for i, k in ipairs(attr) do
+ if type(k) == "string" then
+ local ns, nm = k:match("^([^|]+)|?([^|]-)$")
+ if ns and nm then
+ ns = ns_prefixes[ns];
+ if ns then
+ attr[ns..":"..nm] = attr[k];
+ attr[i] = ns..":"..nm;
+ attr[k] = nil;
+ end
+ end
+ end
+ end
+
+ if not stanza then --if we are not currently inside a stanza