A better XML to JSON proxy
I was looking for a generic way to convert XML to JSON, and I came across this GAE version http://jsonproxy.appspot.com/proxy, however, I noted that it only converted the first node of any tree to JSON, so it missed out most of the data contained in the XML.
Lets say, we wanted to load exchange rates into a mobile app running Javascript (read phonegap /Wrtkit /Webos), an XML feed can be found at http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml (European central bank), but it’s easier to work with JSON than XML in Javascript. If you use the GAE (google app engine) version, then you only get USD, so I wanted to write my own proxy to fix this.
So, with the help of a free .NET Hosting account from brinkster Which worked an absolute charm – I didn’t have to put load on my own server to run this!. I installed my own XML-To-JSON Proxy:
I’ve fixed this, in a C# Implementation:
http://<url>/default.aspx?url=http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
vs
http://jsonproxy.appspot.com/proxy?url=http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
(obviously, you need to urlencode any querystring parameters after the URL in both cases)