local ns_prefixes = {
["http://www.w3.org/XML/1998/namespace"] = "xml";
}
+local ns_separator = "\1";
+local ns_pattern = "^([^"..ns_separator.."]*)"..ns_separator.."?(.*)$";
function init_xmlhandlers(session, stream_callbacks)
local ns_stack = { "" };
stanza:text(t_concat(chardata));
chardata = {};
end
- local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$");
+ local curr_ns,name = tagname:match(ns_pattern);
if name == "" then
curr_ns, name = "", curr_ns;
end
for i=1,#attr do
local k = attr[i];
attr[i] = nil;
- local ns, nm = k:match("^([^\1]*)\1?(.*)$");
+ local ns, nm = k:match(ns_pattern);
if nm ~= "" then
ns = ns_prefixes[ns];
if ns then
end
end
function xml_handlers:EndElement(tagname)
- local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$");
+ local curr_ns,name = tagname:match(ns_pattern);
if name == "" then
curr_ns, name = "", curr_ns;
end