Skip to content

Converts all the XML files to JSON in a given force-app directory. When finished, converts them back to XML.

License

Notifications You must be signed in to change notification settings

rnavroze/salesforce-xml2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

salesforce-xml2json

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.

Installation

  1. Clone this repo
  2. (Optional, you can skip this step if you don't know what it means) Create a virtualenv and activate it
  3. pip install -r requirements.txt

Usage

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.

About

Converts all the XML files to JSON in a given force-app directory. When finished, converts them back to XML.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages