All pastes #2128507 Raw Edit

Miscellany

public diff v1 · immutable
#2128507 ·published 2012-03-15 23:55 UTC
rendered paste body
diff -r f2d695d2e31e util/stanza.lua--- a/util/stanza.lua	Fri Mar 09 18:46:19 2012 +0000+++ b/util/stanza.lua	Thu Mar 15 19:52:51 2012 -0400@@ -146,7 +146,7 @@ 		for i = start_i, max_i do 			local v = tags[i]; 			if (not name or v.name == name)-			and (not xmlns or xmlns == v.attr.xmlns) then+			and (not xmlns or not v.attr.xmlns or xmlns == v.attr.xmlns) then 				start_i = i+1; 				return v; 			end@@ -204,12 +204,13 @@ 	else 		t_insert(buf, ">"); 		for n=1,len do-			local child = t[n];-			if child.name then-				self(child, buf, self, xml_escape, t.attr.xmlns);+			local child = t[n]+			if type ( child ) == "string" then+				child = xml_escape ( child ) 			else-				t_insert(buf, xml_escape(child));+				child = tostring ( child ) 			end+			t_insert ( buf , child ) 		end 		t_insert(buf, "</"..name..">"); 	end