scansion/ordered_serializer.lua

changeset 178
e547ddf8b64d
parent 174
662bd8c5ae28
equal deleted inserted replaced
177:3c19b67a1f0f 178:e547ddf8b64d
1 local s_find, s_gsub, s_match = string.find, string.gsub, string.match; 1 local s_find, s_gsub, s_match = string.find, string.gsub, string.match;
2 local t_concat, t_insert = table.concat, table.insert; 2 local t_concat, t_insert = table.concat, table.insert;
3 3
4 local pairs = require "util.iterators".sorted_pairs; 4 local pairs = require "scansion.helpers".sorted_pairs;
5 5
6 local escape_table = { ["'"] = "&apos;", ["\""] = "&quot;", ["<"] = "&lt;", [">"] = "&gt;", ["&"] = "&amp;" }; 6 local escape_table = { ["'"] = "&apos;", ["\""] = "&quot;", ["<"] = "&lt;", [">"] = "&gt;", ["&"] = "&amp;" };
7 local function xml_escape(str) return (s_gsub(str, "['&<>\"]", escape_table)); end 7 local function xml_escape(str) return (s_gsub(str, "['&<>\"]", escape_table)); end
8 8
9 local function _dostring(t, buf, self, _xml_escape, parentns) 9 local function _dostring(t, buf, self, _xml_escape, parentns)

mercurial