Software /
code /
prosody
Comparison
core/xmlhandlers.lua @ 2281:27441b099984
Merge with tip.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Sun, 29 Nov 2009 21:33:37 +0100 |
parent | 2261:13d55c66bf81 |
child | 2463:d9ff0190eb4a |
child | 2923:b7049746bd29 |
comparison
equal
deleted
inserted
replaced
2280:0b0fe49e5251 | 2281:27441b099984 |
---|---|
48 -- We have some character data in the buffer | 48 -- We have some character data in the buffer |
49 stanza:text(t_concat(chardata)); | 49 stanza:text(t_concat(chardata)); |
50 chardata = {}; | 50 chardata = {}; |
51 end | 51 end |
52 local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$"); | 52 local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$"); |
53 if not name then | 53 if name == "" then |
54 curr_ns, name = "", curr_ns; | 54 curr_ns, name = "", curr_ns; |
55 end | 55 end |
56 | 56 |
57 if curr_ns ~= stream_default_ns then | 57 if curr_ns ~= stream_default_ns then |
58 attr.xmlns = curr_ns; | 58 attr.xmlns = curr_ns; |
61 -- FIXME !!!!! | 61 -- FIXME !!!!! |
62 for i=1,#attr do | 62 for i=1,#attr do |
63 local k = attr[i]; | 63 local k = attr[i]; |
64 attr[i] = nil; | 64 attr[i] = nil; |
65 local ns, nm = k:match("^([^\1]*)\1?(.*)$"); | 65 local ns, nm = k:match("^([^\1]*)\1?(.*)$"); |
66 if ns and nm then | 66 if nm ~= "" then |
67 ns = ns_prefixes[ns]; | 67 ns = ns_prefixes[ns]; |
68 if ns then | 68 if ns then |
69 attr[ns..":"..nm] = attr[k]; | 69 attr[ns..":"..nm] = attr[k]; |
70 attr[k] = nil; | 70 attr[k] = nil; |
71 end | 71 end |
103 t_insert(chardata, data); | 103 t_insert(chardata, data); |
104 end | 104 end |
105 end | 105 end |
106 function xml_handlers:EndElement(tagname) | 106 function xml_handlers:EndElement(tagname) |
107 local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$"); | 107 local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$"); |
108 if not name then | 108 if name == "" then |
109 curr_ns, name = "", curr_ns; | 109 curr_ns, name = "", curr_ns; |
110 end | 110 end |
111 if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then | 111 if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then |
112 if tagname == stream_tag then | 112 if tagname == stream_tag then |
113 if cb_streamclosed then | 113 if cb_streamclosed then |