You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discussion?
While trying to use Dasel as a Go package in a personal project updatecli, I noticed that it drops XML comments, directives, and processes.
Describe the bug
Dasel don't preserve initial XML content.
To Reproduce
The command dasel -f example.xml -p xml
.example.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- This a commment -->
<name>
<firstname tag="xx">John</firstname>
<lastname>Doe</lastname>
</name>
<?xml version="1.0" encoding="UTF-8"?>
<!-- This a commment -->
<name>
<firstname tag="xx">John</firstname>
<lastname>Doe</lastname>
</name>
Expected behavior
I would expect Dasel to preserve all original XML instructions
Screenshots
/
Desktop (please complete the following information):
OS: Linux
Version [1.21.2]
Additional context
After looking at Dasel and mxj code base, It appears that Dasel is manipulating a mxj.Map and could instead use the mxj.MapSeq which seems to preserve everything. I am still new to the two projects so I may need some guidance to contribute to this issue. It appears that some work is needed here but I may be missing something else.
The text was updated successfully, but these errors were encountered:
@TomWright Thanks for looking at this, I started looking at this comment clbanning/mxj#17 (comment) but unfortunately, I run out of time so I can't help as much as I would like to.
Discussion?
While trying to use Dasel as a Go package in a personal project updatecli, I noticed that it drops XML comments, directives, and processes.
Describe the bug
Dasel don't preserve initial XML content.
To Reproduce
The command
dasel -f example.xml -p xml
.example.xml
.output
.expectedOutput
Another example is the command
dasel put string -p xml -f example.xml .name.firstname Tom
on the same example file, generated the following file:Instead of:
.expectedOutput
Expected behavior
I would expect Dasel to preserve all original XML instructions
Screenshots
/
Desktop (please complete the following information):
Additional context
After looking at Dasel and mxj code base, It appears that Dasel is manipulating a mxj.Map and could instead use the mxj.MapSeq which seems to preserve everything. I am still new to the two projects so I may need some guidance to contribute to this issue. It appears that some work is needed here but I may be missing something else.
The text was updated successfully, but these errors were encountered: