util/stanza.lua
changeset 1420 1576a5aa52f8
parent 1416 f916f0ff90e5
child 1431 9fe9ba693f4a
equal deleted inserted replaced
1419:1ac8bcc63a9d 1420:1576a5aa52f8
   156 		for k, v in pairs(t.attr) do if type(k) == "string" then attr_string = attr_string .. s_format(" %s='%s'", k, xml_escape(tostring(v))); end end
   156 		for k, v in pairs(t.attr) do if type(k) == "string" then attr_string = attr_string .. s_format(" %s='%s'", k, xml_escape(tostring(v))); end end
   157 	end
   157 	end
   158 	return s_format("<%s%s>", t.name, attr_string);
   158 	return s_format("<%s%s>", t.name, attr_string);
   159 end
   159 end
   160 
   160 
       
   161 function stanza_mt.get_text(t)
       
   162 	if #t.tags == 0 then
       
   163 		return t_concat(t);
       
   164 	end
       
   165 end
       
   166 
   161 function stanza_mt.__add(s1, s2)
   167 function stanza_mt.__add(s1, s2)
   162 	return s1:add_direct_child(s2);
   168 	return s1:add_direct_child(s2);
   163 end
   169 end
   164 
   170 
   165 
   171