JSON Schema

Approach is based on the XML Schema:
xsd2jsonschema - A pure JavaScript library for translating complex XML Schemas into JSON Schemas.

Other known approaches are provided by the commercial products Altova XML Spy and Oxygen XML Editor.

JSON Schema Generation with xsd2jsonschema - Windows Batch File

run.cmd
1node ddi-cdi.js > ddi-cdi.schema.json

xs:choice Doesn’t Seem to be Implemented

generation.log
 1Error: choice array needs to be implemented!!
 2    at ConverterDraft07.handleChoiceArray (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\converterDraft04.js:328:9)
 3    at ConverterDraft07.choice (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\converterDraft04.js:357:16)
 4    at ConverterDraft07.process (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\converterDraft04.js:134:33)
 5    at BaseConversionVisitor.visit (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\visitors\visitor.js:60:26)
 6    at DepthFirstTraversal.walk (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\depthFirstTraversal.js:47:34)
 7    at DepthFirstTraversal.walk (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\depthFirstTraversal.js:52:12)
 8    at DepthFirstTraversal.walk (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\depthFirstTraversal.js:52:12)
 9    at DepthFirstTraversal.walk (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\depthFirstTraversal.js:52:12)
10    at DepthFirstTraversal.traverse (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\depthFirstTraversal.js:78:9)
11    at Xsd2JsonSchema.processSchema (E:\Git\ddi-cdi_encoding\encoding\xsd_based\json-schema\node_modules\xsd2jsonschema\src\xsd2JsonSchema.js:264:37)