1

Are there any .jars out there that can be used to convert JSON to XML? A lot of the answers on SO contain dead links or involve complex configuration.

Ideally it would be nice just to include a jar in my existing project that currently converts XML to JSON. I just need it the other way around to be complete.

Jon
  • 3,174
  • 11
  • 39
  • 57

2 Answers2

1

Have a look at this article:

From the article:

Use json-lib, a library which adds JSON support to any Java program. json-lib provides an XMLSerializer which can be used to output XML from a JSON object.

Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85
0

I would recommand to convert JSON to java classes (using GSON for instance), then the java classes to XML (possibly using JAXB). Then you'll have a comprehensive way to manage how you want to perform the conversion.

Samuel EUSTACHI
  • 3,116
  • 19
  • 24