hay/xml2json — pull request #8 by akesterson (2013-06-12 14:32:22+00:00)
Title: Remove XML namespaces ("{....}") from json hash keys

Currently the json output from xml2json looks like this:

$ ./xml2json.py -t xml2json test.xml | head -n 1 | python -c 'import sys; import json; print json.dumps(json.loads(sys.stdin.read()), indent=4, sort_keys=True)' | head -n 10
{
"{https://route53.amazonaws.com/doc/2012-12-12/}ListHostedZonesResponse": {
"{https://route53.amazonaws.com/doc/2012-12-12/}HostedZones": {
"{https://route53.amazonaws.com/doc/2012-12-12/}HostedZone": [
{

... That's really difficult for humans to grok, and doesn't really help when expecting to use the results as a dictionary in some other python code. This patch fixes the output to be a little more human friendly:

$ ./xml2json.py -t xml2json test.xml | head -n 1 | python -c 'import sys; import json; print json.dumps(json.loads(sys.stdin.read()), indent=4, sort_keys=True)' | head -n 10
{
"ListHostedZonesResponse": {
"HostedZones": {
"HostedZone": [
{