core/xmlhandlers.lua

changeset 1008
afae75e37ceb
parent 899
b95368f199a1
child 1051
0327c569eb1a
equal deleted inserted replaced
1007:5265657d7c12 1008:afae75e37ceb
55 if stanza and #chardata > 0 then 55 if stanza and #chardata > 0 then
56 -- We have some character data in the buffer 56 -- We have some character data in the buffer
57 stanza:text(t_concat(chardata)); 57 stanza:text(t_concat(chardata));
58 chardata = {}; 58 chardata = {};
59 end 59 end
60 local curr_ns,name = tagname:match("^(.+)|([%w%-]+)$"); 60 local curr_ns,name = tagname:match("^(.+)|([^%|]+)$");
61 if curr_ns ~= stream_default_ns then 61 if curr_ns ~= stream_default_ns then
62 attr.xmlns = curr_ns; 62 attr.xmlns = curr_ns;
63 end 63 end
64 64
65 -- FIXME !!!!! 65 -- FIXME !!!!!
107 if stanza then 107 if stanza then
108 t_insert(chardata, data); 108 t_insert(chardata, data);
109 end 109 end
110 end 110 end
111 function xml_handlers:EndElement(tagname) 111 function xml_handlers:EndElement(tagname)
112 curr_ns,name = tagname:match("^(.+)|([%w%-]+)$"); 112 curr_ns,name = tagname:match("^(.+)|([^%|]+)$");
113 if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then 113 if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then
114 if tagname == stream_tag then 114 if tagname == stream_tag then
115 if cb_streamclosed then 115 if cb_streamclosed then
116 cb_streamclosed(session); 116 cb_streamclosed(session);
117 end 117 end

mercurial