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
"Working with XML" documentation example does not work for version 4.17.2 #1095
Comments
Yep sorry, in versions prior to 4.18 you still need to use the 'e/eval' command - you can either update to the latest one, or yq -p=xml e '.' file.xml |
FWIW There was a notification on the readme - but that's easy to miss, I've now added a notification banner to the individual docs. |
:) Thanks for quick reply! |
I'm trying upgraded to version 4.18.1 yq with following results
Whithout e
With e
File permissions
With stdin
And finally it works :)
Yes, yq installed from snap. As I described when open the issue. |
Hmm - that's not right :/ |
I couldn't replicate the permissions errors with 'samle.xml' - (even when I installed snap) it must be a snap confinement thing. If you're able to download the binary from the github releases - I'd be interested to see if those command then work. The stdin example |
You are right. This is snap related issue.
|
Fixed STD bug in 4.20.1 |
XML does not work once again :(
|
Weird - it works for me... cat examples/mike.xml| yq -p=xml '.'
cat:
says: meow
legs: "4"
cute: "true"
~/dev/yq ➦ 03f57b7 ± yq --version
yq (https://github.com/mikefarah/yq/) version 4.23.1 |
|
Something weird is going on there after the last 'AddChild' - for some reasons it starts to parse the expression again 🤔
I can't re-create that locally, so it's hard to diagnose. Can you try with docker: cat examples/mike.xml | docker run -i mikefarah/yq:4.23.1 -p=xml Also, can you try from the binaries in github releases? I don't entirely trust snap and it's containment magic.. |
Oh - and can you try with a yaml file too? wonder if this is specifically an XML thing or not. |
|
Update. Version of yq is unknown here :) |
|
And I see no problems now in 4.24.2 (snap) version
Thank you! P.S.
|
Righto! not sure what was going on before ... glad it's working now |
Describe the bug
Trying "Parse xml: simple" from top of this page
https://mikefarah.gitbook.io/yq/usage/xml
Version of yq: 4.17.2
$ yq --version
yq (https://github.com/mikefarah/yq/) version 4.17.2
Operating system: Ubuntu 20.04.3 LTS
Installed via: snap
$ snap list |grep yq
yq 4.17.2 1557 latest/stable mikefarah
Input XML
test.xml:
Command
The command you ran:
Actual behavior
Error: unknown command "." for "yq"
Run 'yq --help' for usage.
Expected behavior
Additional context
no
The text was updated successfully, but these errors were encountered: