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

json_util_pkg generates invalid JSON for numbers less than 1 #1

Open
eaolson opened this issue Feb 27, 2015 · 1 comment
Open

json_util_pkg generates invalid JSON for numbers less than 1 #1

eaolson opened this issue Feb 27, 2015 · 1 comment

Comments

@eaolson
Copy link
Contributor

eaolson commented Feb 27, 2015

The json_util_pkg will generate invalid JSON with the value getting converted is a number between 0 and 1.

BEGIN
  dbms_output.put_line( json_util_pkg.sql_to_json( 'select 0.5 as x from dual' ));
END;
/

Generates:

{"ROWSET":{"ROW":{"X":.5}}}

Neither IE 11 nor Firefox 35 will parse this result. The JSON specification says that numbers must begin with a digit. Numbers beginning with the decimal point are invalid.

@eaolson
Copy link
Contributor Author

eaolson commented Apr 15, 2015

It looks like the problem lies in the xml2json-xslt stylesheet this package relies on to make the xml-to-JSON conversion. The project for this stylesheet has migrated to https://github.com/doekman/xml2json-xslt. I tried the latest version, but it did not fix the problem.

mortenbra pushed a commit that referenced this issue Mar 7, 2016
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

No branches or pull requests

1 participant