Skip to content

Struggling with xml put, no value #220

Answered by TomWright
yorickdowne asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, thanks for the question.

I've had a play around and the issue here is with the XML parser providing somewhat of a ghost root node.

A simple workaround that works is the following:

dasel put document -f sample.xml -d json -o out.xml 'nlog.rules.logger.[]' '{"-name":"JsonRpc.*","-minlevel":"Error","-writeTo":"file-async"}'

Example:

The original file:

$ cat sample.xml
<nlog>
    <rules>
        <logger name="JsonWebAPI.Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService" maxLevel="Error" final="true" />
        <logger name="JsonWebAPI*" minlevel="Error" writeTo="file-async" />
        <logger name="JsonWebAPI*" minlevel="Error" writeTo="auto-colored-console-async" f…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@TomWright
Comment options

@yorickdowne
Comment options

@TomWright
Comment options

@yorickdowne
Comment options

@TomWright
Comment options

Answer selected by yorickdowne
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants