# HG changeset patch # User Matthew Wild # Date 1240517004 -3600 # Node ID 0327c569eb1a5a723d3051eec2fbc53b1b45a2bd # Parent c476bceaf2db4e55fd57dbe3724e9f4b9ef35d51 xmlhandlers: Fix tag pattern again for the default namespace diff -r c476bceaf2db -r 0327c569eb1a core/xmlhandlers.lua --- a/core/xmlhandlers.lua Thu Apr 23 03:27:22 2009 +0100 +++ b/core/xmlhandlers.lua Thu Apr 23 21:03:24 2009 +0100 @@ -57,7 +57,11 @@ stanza:text(t_concat(chardata)); chardata = {}; end - local curr_ns,name = tagname:match("^(.+)|([^%|]+)$"); + local curr_ns,name = tagname:match("^(.-)|?([^%|]-)$"); + if not name then + curr_ns, name = "", curr_ns; + end + if curr_ns ~= stream_default_ns then attr.xmlns = curr_ns; end @@ -109,7 +113,10 @@ end end function xml_handlers:EndElement(tagname) - curr_ns,name = tagname:match("^(.+)|([^%|]+)$"); + curr_ns,name = tagname:match("^(.-)|?([^%|]-)$"); + if not name then + curr_ns, name = "", curr_ns; + end if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then if tagname == stream_tag then if cb_streamclosed then