util.xtemplate

util.xtemplate implements a string template language, similar to util.interpolation but different. Notably, it takes as input an XML stanza rather than a Lua table.

For example:

local st = require "util.stanza"
local xtemplate = require "util.xtemplate"

print(xtemplate.render("{greet}", st.stanza("root"):text_tag("greet", "Hello")));
--> Hello