quandyfactory / dicttoxml

Simple library to convert a Python dictionary or other native data type into a valid XML string.
GNU General Public License v2.0
382 stars 147 forks source link

Root and header not formed #101

Open demongolem-biz2 opened 1 year ago

demongolem-biz2 commented 1 year ago

I have a dict that I converted using xml = dict2xml(a) and what I got back is

\<Body>B\</Body> \<Footer>F\</Footer> \<Title>T\</Title>

when a is

a = {'Title': 'T', 'Body': 'B', 'Footer': 'F'}

So it is out of order and not a full xml document with root and header

javadev commented 1 year ago
{"Title": "T", "Body": "B", "Footer": "F"}

may be converted to xml

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <Title>T</Title>
  <Body>B</Body>
  <Footer>F</Footer>
</root>