views:

455

answers:

4

Is there an XSLT equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.

A: 

I think not, but python and javascript do a good job slurping in JSON. Great idea, though.

Ewan Todd
+3  A: 

Interesting idea. Some searching on Google produced a few pages of interest, including:

Hope this helps.

Tim
Yup, thank you, that's what I was looking for. It's a pity the technique isn't more popular, JSON is quite often used as a return format in REST-style services and it would be nice to have a standard way of implementing transformations to it.
luvieere
A: 

Not too sure there is need for this, and to me lack of tools suggests lack of need. JSON is best processed as objects (the way it's done in JS anyway), and you typically use language of the objects itself to do transformations (Java for Java objects created from JSON, same for Perl, Python, Perl, c#, PHP and so on). Just with normal assignments (or set, get), looping and so on.

I mean, XSLT is just another language, and one reason it is needed is that XML is not an object notation and thus objects of programming languages are not exact fits (impedance between hierarchic xml model and objects/structs).

StaxMan