0

In (at least) one of our projects we are using Jackson to map bewtween JSON and Java objects and vice versa. We are also using Jettison to map between XML input streams to JSON objects (and vice versa).

A typical use case of the latter is to apply an XSLT transformation on a source XML document to a "JSONized" XML structure, which can be directly rendered as JSON using a StaxStreamResult and a MappedXMLStreamWriter. Now, I'm curious if Jackson can do the same as Jettison in the XSLT area. I've studied the documentation and scrutinized the JAR deliverables, and my conclusion is: No, it cannot. But I may have missed something.

So, this is a sanity check. Can I use Jackson to perform XSLT transformations from XML to JSON as well as from JSON to XML, and expect the same result as with Jettsion?

forty-two
  • 12,204
  • 2
  • 26
  • 36

1 Answers1

1

I don't think so - by the amount of complexity I think that you will need to write down an parser (I'm used to create some xslt to transform my stuff but I'm always trying to keep it simple and sane - even if you could it would end up way too complex, IMHO)

agodinhost
  • 381
  • 4
  • 16
  • The problem is not xslt, it is if Jackson can produce JSON from XML in a way that is compatible with a javax.xml.transform setup. – forty-two Jul 03 '13 at 23:21
  • Sorry, I got it wrong. Take a look at here (http://www.cowtowncoder.com/blog/archives/2009/01/entry_137.html) and here (http://www.bramstein.com/projects/xsltjson/), I think this guy is doing exactly what you want without Jackson. – agodinhost Jul 03 '13 at 23:32