--- a/util/datamapper.lua Sat Mar 06 23:14:23 2021 +0100
+++ b/util/datamapper.lua Sun Mar 07 01:41:39 2021 +0100
@@ -48,8 +48,10 @@
if name_is_value then
local c = s:get_child(nil, namespace);
- if c then
+ if c and proptype == "string" then
out[prop] = c.name;
+ elseif proptype == "boolean" and c then
+ out[prop] = true;
end
elseif is_attribute then
local attr = name
@@ -182,8 +184,12 @@
if namespace ~= current_ns then
propattr = {xmlns = namespace}
end
- if name_is_value and type(v) == "string" then
- out:tag(v, propattr):up();
+ if name_is_value then
+ if proptype == "string" and type(v) == "string" then
+ out:tag(v, propattr):up();
+ elseif proptype == "boolean" and v == true then
+ out:tag(name, propattr):up();
+ end
elseif proptype == "string" and type(v) == "string" then
out:text_tag(name, v, propattr)
elseif proptype == "number" and type(v) == "number" then