Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling xml.serialize_to_string() without an indent leaves out <?xml version="1.0" encoding="utf-8"?> #31

Open
efraimbart opened this issue Aug 15, 2022 · 0 comments

Comments

@efraimbart
Copy link

efraimbart commented Aug 15, 2022

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"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant