Skip to content
sanger edited this page Sep 13, 2010 · 3 revisions

I’ve been developing XUL-based applications for a year or two and converted much of the HTTP interfaces to use JSON. It’s pretty light compared to XML and now (in Firefox 3.1 at least) has a native JSON parser built in.

The problem is that looking at JSON is pretty difficult. There are web pages that will format it in a pretty way but you have to request the JSON, cut and paste it in – in short, it’s a royal pain.

So I decided that I would kill two birds with one stone. First, write a XUL app that would fetch JSON directly from a URL, and second display it in a XUL hierarchical tree display. I’ve always been meaning to get one of those trees working but the MDC documentation is pretty thin (and opaque) and there are very few examples to learn from out there on the net. So this would force me to work out how the hell they worked.

So here it is “xultree”. Simple enter a URL in the textbox which points to a web service delivering JSON and click “Fetch”. The JSON is parsed and displayed. The tree structure makes is easy to navigate. Contained objects like arrays and, um, objects can be collapsed and expanded.

I’d like to implement internal data links so tree items can be used to expand bits of the tree dynamically. But that’s not fully there yet and it kind of works OK for me now.

Enjoy and send me comments!

Clone this wiki locally