Popular Posts

Monday, January 13, 2014

Invalid JSON Number after store://jsonxtojson.xsl transformation

"json:number" is coming invalid after store://jsonxtojson.xsl transformation". We have been facing this issue with JSONX 2 JSON transformation.

e.g. <json:number name="balance"></json:number> "Converts to" {"balance":} which is not a valid JSON.

DataPower implements specs, according the JSON spec an empty string is NOT a number:

http://tools.ietf.org/html/rfc4627#page-4
(because of the "int" it has to contain at least one digit)

You have to make sure that the JSONX you generate follows the spec, then conversion is done without problems.


Alternatively (but that is not a best practice), you could copy json2jsonx.xsl to "local:" folder and modify to your needs.

No comments:

Post a Comment