Task: Convert XML to JSON in Python
Task: Convert XML to JSON in Python: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script that converts XML data into a JSON equivalent. The script should read an XML file, parse its structure, and output a well-formed JSON representation that preserves the hierarchy, element names…
The task
Write a Python script that converts XML data into a JSON equivalent. The script should read an XML file, parse its structure, and output a well-formed JSON representation that preserves the hierarchy, element names, attributes, and text content of the original XML.
Part of PrimeIntellect/Terminal-Lego-15k.