kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.58k stars 83 forks source link

xq: Error running jq: ExpatError: not well-formed #76

Closed ghost closed 4 years ago

ghost commented 4 years ago

Here:

https://github.com/kislyuk/yq#xml-support

It says:

Roundtrip transcoding is available with the xq --xml-output / xq -x option.

but it doesnt actually work that way:

$ echo '{"foo": "bar"}' | xq -x .
xq: Error running jq: ExpatError: not well-formed (invalid token): line 1,
column 0.

This does work:

$ echo '{"foo": "bar"}' | yq -x .
<foo>bar</foo>
kislyuk commented 4 years ago

You misunderstood the documentation. xq expects XML input, while yq expects JSON input. -x controls the output format.

ghost commented 4 years ago

@kislyuk what documentation?

It seems that you are saying the quoted documentation is for xq -x. If thats the case, then yq -x isnt actually documented.

kislyuk commented 4 years ago

Correct.

On Wed, Nov 6, 2019 at 7:46 AM Steven Penny notifications@github.com wrote:

@kislyuk https://github.com/kislyuk what documentation?

It seems that you are saying the quoted documentation is for xq -x. If thats the case, then yq -x isnt actually documented.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kislyuk/yq/issues/76?email_source=notifications&email_token=AAGSOPKVHBZPGIOGSLBFLTTQSLRGRA5CNFSM4JJPRYH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDG7VMQ#issuecomment-550369970, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSOPOPZMVMQTKSEIOBMJLQSLRGRANCNFSM4JJPRYHQ .