builtins.toXML generates self-closing tags where it shouldn't
#399
Opened by qyliss at
builtins.toXML {}
cppnix:
<?xml version='1.0' encoding='utf-8'?> <expr> <attrs> </attrs> </expr>
tvix:
<?xml version='1.0' encoding='utf-8'?> <expr> <attrs /> </expr>
- qyliss updated the body of this issue at 2024-04-09T10·04+00
With cppnix, some elements are self-closing, but not all —
int
is self-closing, butattrs
never is.xml-rs doesn't support varying whether empty elements are self-closing except with a global setting, so either xml-rs has to be changed to implement this, or XML generation has to be implemented in a different way.
This came up for me in the context of grub-config.xml in NixOS.
qyliss at 2024-04-09T14·23+00
fixed by cl/11697, which includes this example as a testcase (
tvix/eval/src/tests/tvix_tests/eval-okay-toxml-empty.nix
).flokli at 2024-05-22T10·58+00
- flokli closed this issue at 2024-05-22T10·58+00