1

I want to convert request xml to JSON string. which framework is better to use? jettison, jackson, json-org,... and also how can I do this? Any idea? thanks Afsaneh

Programmer Bruce
  • 64,977
  • 7
  • 99
  • 97
A. Abouei
  • 51
  • 6

1 Answers1

1

If the goal is to go straight from XML to JSON, without any structure transformations, data changes, or inspections, then XStream or even the JSON in Java reference implementation at org.json can get the job done rather simply. In similar fashion, XSLT options are available, including XSLTJSON and xml2json-xslt.

If complicated interrogation and/or manipulation of the data and resulting JSON are in order, then Jackson combined with the jackson-xml-databind extension provide for a feature-rich option that also has excellent performance. (Performance comparisons of some JSON and XML serialization APIs are available at https://github.com/eishay/jvm-serializers/wiki.)

Programmer Bruce
  • 64,977
  • 7
  • 99
  • 97