Skip to content

add xml support as xq (from python yq)#215

Open
momiji wants to merge 28 commits into
itchyny:mainfrom
momiji:main
Open

add xml support as xq (from python yq)#215
momiji wants to merge 28 commits into
itchyny:mainfrom
momiji:main

Conversation

@momiji

@momiji momiji commented Jun 6, 2023

Copy link
Copy Markdown

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.

@momiji

momiji commented Jun 7, 2023

Copy link
Copy Markdown
Author

hello, I'm still doing havy tests on our servers, I let you know when it is ready for publishing

Comment thread cli/cli.go
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"`

Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Author

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 :)

@momiji

momiji commented Aug 7, 2023

Copy link
Copy Markdown
Author

If anyone is interested, a binary built called "xjq" is available here; https://github.com/momiji/xjq.
It is build using the updated forked gojq code, which is near up-to-date: momiji/gojq@main...itchyny:gojq:main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants