An in-progress Perl script for moving XML files to the JSON format or vice-versa.
Parser script requires the following modules:
- JSON
- JSON::Validator
- XML::Simple
- XML:LibXML
- Switch
Packages can be installed with the cpan command:
cpan install JSON
cpan install JSON::Validator
cpan install Switch
cpan install XML:LibXML
cpan install XML::Simple
Takes an input file, it's format, and output file as arguments.
Usage, ./parser.pl format inFile outFile /path/to/outputFolder
Ex. ./parser.pl xml inFile.xml outFile.json ~/Documents
Parsed files are saved by default to ~/.
Passing an output filepath overrides this setting.
Has checks for files and file validation.
There are sample JSON and XML files located in the sampleInput folder.