Skip to content

airtechzone/xml-json-metadata-generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

XML-JSON Conversion Metadata Generation

This tool generates, from a XSD file (xsdFile), two JSON files and one text file:

  • xsdFile-sequences.json: all the sequences (identified by xpath) with their ordered list of elements;
  • xsdFile-singletons.json: the xpaths of all elements with maxOccurs = 1 (explicitly or implicitly);
  • xsdFile-xpaths.txt: flat list of all the xpaths.

Usage:

./metadataGeneration.py <xsdFile> [-v]

(-v: verbose/debug mode)

In order to prevent infinite loops, the tree exploration does not exceed a depth of 50.

Example of command (on Linux) to process all XSDs in a folder:

cd path_to_metadataGeneration
for xsd in path_to_xsd/*.xsd; do ./metadataGeneration.py "$xsd"; done 
cat *.xsd-sequences.json > sequences.json
cat *.xsd-singletons.json > singletons.json

Then simply replace }{ by ,\n in sequences.json, and ][ by ,\n in singletons.json.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages