Skip to main content
=================================
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 notifications | RSS feed

This release

0.0.1 This release

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page