tomasguisasola / luasoap

LuaSOAP provides a very simple API that convert Lua tables to and from XML documents
57 stars 18 forks source link

Built in escaping of xml tag contents. #1

Closed mockobject closed 12 years ago

mockobject commented 13 years ago

This patch includes an update that builds in escaping of special characters passed in as contents of xml tags without re-escaping & in escape codes. This change should work fine for people already escaping their xml tag contents and will escape them when not already escaped.

I don't know if you would be interested in this change or not but since it is backwards compatible with people who have already escaped their strings I figured it might be worth offering.

tomasguisasola commented 12 years ago

I've added your suggestion but with a different implementation (a table with the replacements seems faster than a sequence of gsub calls). Anyway, thanks!

mockobject commented 12 years ago

Oh cool, yeah, that change with the tables seems a lot better. Thanks a bunch.