json2xml: handle null

This commit is contained in:
xfnw 2023-06-23 13:14:51 -04:00
parent 89cb037efa
commit 4031bc5161
1 changed files with 3 additions and 1 deletions

View File

@ -39,8 +39,10 @@ def node_to_xml:
as $children |
"<" + .name + $attrs + ">" + $children + "</" +
.name + ">"
else
elif .name then
"<" + .name + $attrs + "/>"
else
"<!---->"
end
end
;