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 = { ["'"] = "'", ["\""] = """, ["<"] = "<", [">"] = ">", ["&"] = "&" }; |
6 local escape_table = { ["'"] = "'", ["\""] = """, ["<"] = "<", [">"] = ">", ["&"] = "&" }; |
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) |