Prolog/CHR module to translate an XML Schema into equivalent JSON Schema.
This tool has been developed as part of my Bachelor's Thesis at University of Ulm, Germany. The thesis (PDF) explains the general idea of the translation process via Prolog and Constraint Handling Rules (CHR). It also contains tabular and graphical representations of the implemented translations of XML Schema fragments. A shorter explanation of the translation process can be found in the CHR Workshop paper "From XML Schema to JSON Schema: Translation with CHR".
All you need is SWI-Prolog. xsd2json
provides a command line interface. You can use it via
swipl -q -f cli.pl -- < /path/to/your.xsd
For further instructions, e.g. how to use xsd2json
programmatically, have a look at the tool's Readme.
xsd2json
is developed in a test-driven way. This reflects in the project's folder structure, too: The /lib
directory contains the Prolog and CHR stuff while you will find the TAP testing framework implemented in node.js under /test
. Both directories contain their own Readme-File that explain the usage of the given tools.