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

Incorrect escaping of XML special characters #425

Open
pokle opened this issue Aug 22, 2024 · 0 comments
Open

Incorrect escaping of XML special characters #425

pokle opened this issue Aug 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pokle
Copy link

pokle commented Aug 22, 2024

dasel appears to not escape XML special characters like <, > and & when emiting XML.

For example, echo '{"<": "<", ">": ">", "&": "&"}' | dasel -r json -w xml emits:

<doc>
  <&>&</&>
  <<><</<>
  <>>></>>
</doc>

which is invalid XML. Even dasel can't parse it again:

echo '{"<": "<", ">": ">", "&": "&"}' | dasel -r json -w xml | dasel -r xml
Error: could not unmarshal data: xml.Decoder.Token() - XML syntax error on line 2: expected element name after <
@pokle pokle added the bug Something isn't working label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant