Software /
code /
prosody
Comparison
core/xmlhandlers.lua @ 1051:0327c569eb1a
xmlhandlers: Fix tag pattern again for the default namespace
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 23 Apr 2009 21:03:24 +0100 |
parent | 1003:afae75e37ceb |
child | 1153:1184cb19b6f2 |
comparison
equal
deleted
inserted
replaced
1049:c476bceaf2db | 1051:0327c569eb1a |
---|---|
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("^(.+)|([^%|]+)$"); | 60 local curr_ns,name = tagname:match("^(.-)|?([^%|]-)$"); |
61 if not name then | |
62 curr_ns, name = "", curr_ns; | |
63 end | |
64 | |
61 if curr_ns ~= stream_default_ns then | 65 if curr_ns ~= stream_default_ns then |
62 attr.xmlns = curr_ns; | 66 attr.xmlns = curr_ns; |
63 end | 67 end |
64 | 68 |
65 -- FIXME !!!!! | 69 -- FIXME !!!!! |
107 if stanza then | 111 if stanza then |
108 t_insert(chardata, data); | 112 t_insert(chardata, data); |
109 end | 113 end |
110 end | 114 end |
111 function xml_handlers:EndElement(tagname) | 115 function xml_handlers:EndElement(tagname) |
112 curr_ns,name = tagname:match("^(.+)|([^%|]+)$"); | 116 curr_ns,name = tagname:match("^(.-)|?([^%|]-)$"); |
117 if not name then | |
118 curr_ns, name = "", curr_ns; | |
119 end | |
113 if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then | 120 if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then |
114 if tagname == stream_tag then | 121 if tagname == stream_tag then |
115 if cb_streamclosed then | 122 if cb_streamclosed then |
116 cb_streamclosed(session); | 123 cb_streamclosed(session); |
117 end | 124 end |