-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add xml support as xq (from python yq) #215
base: main
Are you sure you want to change the base?
Conversation
hello, I'm still doing havy tests on our servers, I let you know when it is ready for publishing |
@@ -61,13 +71,22 @@ type flagopts struct { | |||
OutputCompact bool `short:"c" long:"compact-output" description:"output without pretty-printing"` | |||
OutputIndent *int `long:"indent" description:"number of spaces for indentation"` | |||
OutputTab bool `long:"tab" description:"use tabs for indentation"` | |||
OutputYAML bool `long:"yaml-output" description:"output in YAML format"` | |||
OutputYAML bool `short:"y" long:"yaml-output" description:"output in YAML format"` | |||
OutputXML bool `short:"x" long:"xml-output" description:"output in XML format"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note: I'm not the author of gojq, just an interested third party.)
I think it makes sense to add even more formats in the future (toml, msgpack, bson, etc), but this list of boolean flags will grow unmanageable.
What do you think about --input-format=xml
and --output-format=xml
instead of these format-specific parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, looks to be a very good idea :)
If anyone is interested, a binary built called "xjq" is available here; https://github.com/momiji/xjq. |
The idea it to add xml support the same as xq (installed with python yq).
It supports multiple xml inputs, that xq does not allow.
On read, much faster than original xq.
On write, many times faster than json2xml.
I'm opened to ideas.