Open efraimbart opened 2 years ago
Running
import json import declxml as xml processor = xml.dictionary('Container', [ xml.string('.', attribute='test') ]) container = """ { "test": 1 } """ print('Without indent:', xml.serialize_to_string(processor, json.loads(container))) print('-----------------------------') print('With indent', xml.serialize_to_string(processor, json.loads(container), indent=' '))
produces
Without indent: <Container test="1" /> ----------------------------- With indent <?xml version="1.0" encoding="utf-8"?> <Container test="1"/>
Running
produces