Thread: xml safe data
-
December 27th, 2010, 21:11 #1
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
xml safe data
Does anyone have routines in lua that take strings and produce xml safe data (that is no & and <) from it (and vice versa)? Just too lazy to write them.
-
December 27th, 2010, 21:30 #2
I have some badly-written encode/decode routines:
Code:function xmlEncode(value) local result = string.gsub(value,"&","&"); result = string.gsub(result,"<","<"); result = string.gsub(result,">",">"); return result; end function xmlDecode(value) local result = string.gsub(value,">",">"); result = string.gsub(result,"<","<"); result = string.gsub(result,"&","&"); return result; end
Stuart
-
December 31st, 2010, 12:25 #3
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Thanks, Stuart. I wrote something based on this.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks