This Python script converts XML data into JSON format. It provides two main functions: parse_element() and convert_xml_to_json().
- parse_element(element): Recursively parses an XML element and creates a dictionary representation.
- convert_xml_to_json(xml_string): Converts an XML string to a JSON string.
To use the script, provide an XML string or file, and run the script to convert XML to JSON. The resulting JSON string will be printed to the console.
Just Python 3.6.9
Name | Stmts | Miss | Branch | BrPart | Cover |
---|---|---|---|---|---|
xml2Json.py | 27 | 6 | 12 | 2 | 79% |
xml2Json_test.py | 15 | 1 | 4 | 1 | 89% |
TOTAL | 42 | 7 | 16 | 3 | 83% |
This project is licensed under the MIT License - see the LICENSE.md file for details