If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Wednesday, October 28, 2009

server side script for generating JSON with Cocoon

I've been making use of JSON a lot lately since it's fast and convenient to make partial updates on your webpage. I wrote me some reusable flowscript to generate the necessary JSON data.

If you put this script inside your flow folder you can easily generate a JSON string.

A sample is listed below.


My relevant sitemap snippets:


jsonlibtest.jx looks like:


The result looks like