Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Converts JSON file into XML

Project Description
=================================
JSON XML CONVERTER
=================================

JSONXMLCONVERTER is a python module to read json files and created xml files
out of it.
Typical usage looks like this:
#!/usr/bin/env python

from jsonxmlconverter import jsonxmlconverter

inputfile = "1.json"
outputfile = "1.xml"
j = jsonxmlconverter(inputfile)
out = open(outputfile, 'w')
j.setIndent("\t") # set indentation to "\t"
j.generateXMLFile(outputfile)

-------------------------------------------------------------------------
Input file(1.json):
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
-------------------------------------------------------------------------
Output file(1.xml):

<glossary>

<GlossDiv>

<GlossList>

<GlossEntry>

<GlossDef>

<GlossSeeAlso>
GML
</GlossSeeAlso>
<GlossSeeAlso>
XML
</GlossSeeAlso>
<para>
A meta-markup language, used to create markup languages such as DocBook.
</para>
</GlossDef>
<GlossSee>
markup
</GlossSee>
<Acronym>
SGML
</Acronym>
<GlossTerm>
Standard Generalized Markup Language
</GlossTerm>
<Abbrev>
ISO 8879:1986
</Abbrev>
<SortAs>
SGML
</SortAs>
<ID>
SGML
</ID>
</GlossEntry>
</GlossList>
<title>
S
</title>
</GlossDiv>
<title>
example glossary
</title>
</glossary>
Release History

Release History

This version
History Node

0.0.1

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting