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

Update xml-to-json.xsl #15

Merged
merged 1 commit into from
May 16, 2022
Merged

Conversation

Jedimark84
Copy link
Contributor

Fixed an issue where negative numbers starting with a zero must be treated as a string to maintain valid JSON output.

Fixed an issue where negative numbers starting with a zero must be treated as a string to maintain valid JSON output.
@Jedimark84
Copy link
Contributor Author

Given the following xml:

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <test>-0123456789</test>
</root>

It produces invalid JSON:
{"root":{"test":-0123456789}}

Proposed fix will treat -0123456789 as a string and return the following valid JSON:
{"root":{"test":"-0123456789"}}

@bramstein bramstein merged commit f3269d1 into bramstein:master May 16, 2022
@Jedimark84 Jedimark84 deleted the Jedimark84-patch-1 branch May 16, 2022 15:16
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