Converts an XML file to JSON or all the XML files to JSON in a given force-app directory. When finished, converts them back to XML.
- Clone this repo
- (Optional, you can skip this step if you don't know what it means) Create a virtualenv and activate it
pip install -r requirements.txt
python xml2json.py --toxml|--tojson|-x|-j file|directory
Converts all XML files in a given force-app dir to JSON, or vice-versa. The original XML files are not deleted. JSON files are only converted to XML if a corresponding XML file exists in the same directory. In other words, only JSON files which were generated by this tool will be converted back to XML files.
Arguments
-j, --tojson: Converts all XML files to JSON. Does not delete the original XML files.
-x, --toxml: Converts all JSON files with corresponding XML counterparts back to XML, and deletes the JSON file.
file: Path to a file.
directory: Path to force-app directory. It is recommended to run --tojson once followed by --toxml to update the line spacing and indentation first if you are planning to use this tool in a bulk fashion.