Skip to content
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

Filtering output of XML file does not return line breaks while JSON does #2136

Open
mgutt opened this issue Aug 22, 2024 · 0 comments
Open
Labels

Comments

@mgutt
Copy link

mgutt commented Aug 22, 2024

XML Input

<POSTER_LIST>
 <GROUP NUMBER="1">
  <POSTER>front.pdf</POSTER>
  <POSTER>back.pdf</POSTER>
 </GROUP>
 <GROUP NUMBER="2">
  <POSTER>front.pdf</POSTER>
  <POSTER>back.pdf</POSTER>
 </GROUP>
</POSTER_LIST>

Does not return line breaks:

# yq '.POSTER_LIST.GROUP[].POSTER[]' file.xml
front.pdfback.pdffront.pdfback.pdf

While using the same filter for a json file does:

# yq -oj file.xml | yq '.POSTER_LIST.GROUP[].POSTER[]'
front.pdf
back.pdf
front.pdf
back.pdf

Version:

 # yq -V
yq (https://github.com/mikefarah/yq/) version v4.44.3
@mgutt mgutt changed the title Filterung output of XML file does not return line breaks while JSON das Filterung output of XML file does not return line breaks while JSON does Aug 22, 2024
@mgutt mgutt changed the title Filterung output of XML file does not return line breaks while JSON does Filtering output of XML file does not return line breaks while JSON does Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant