Java code to convert JSON to XML

I am looking for Java code that I can use (i.e. open source) to convert a JSON string into XML.

I don't care so much about having a lot of control on how the conversion is done, as once I have XML, I can easily transform it with XSLT.

Any recommendation?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Geert BormansConnect With a Mentor Information ArchitectCommented:

If you need I also have references for JavaScript or XSLT2 libraries that do that
abelConnect With a Mentor Commented:
Here's one possibility:

But this is perhaps simpler: It contains a small JavaScript snippet (yes, I know you use Java), that shows how to parse the JSON code into XML. See the source of that page (the popup shows only the output).
avernetAuthor Commented:
@abel, thank you for responding. I have been looking at the two links you mentioned:


The P6R code in C++ , so that won't work for me, but maybe other people reading this will find it useful.


This is some very simple (= good!) code that uses Prototype. I don't fancy Prototype, but maybe will run with the idea. (I would have preferred a more robust, server-side solution to this.)
> I would have preferred a more robust, server-side solution to this

basically, the reason I mentioned, is that the same technique could be applied using java (or c# or whatever) on the server side. The simplicity was chosen because it makes it easier to adopt it for yourself, at least, that was the intention :)
avernetAuthor Commented:
@Gertone,Jettison seems the way to go. Also see this example from the XStream FAQ:

I will some experiments with this, and will report on it.
All Courses

From novice to tech pro — start learning today.