sanand0 / xmljson

xmlsjon converts XML into Python dictionary structures (trees, like in JSON) and vice-versa.
MIT License
121 stars 33 forks source link

Don't strip whitespace in xml text values #46

Closed imoore76 closed 4 years ago

imoore76 commented 4 years ago

It is not part of the XML spec to strip spaces from tag values. This is causing problems in a project I'm working on where things like:

<string>W3lcOme\ </string>

become

"W3lcOme\"

I tried to justify it by attempting to find something in the specification that says whitespace should be stripped, but all I could find was contrary documentation saying whitespace in tag text should be preserved.

imoore76 commented 4 years ago

This fixes https://github.com/sanand0/xmljson/issues/41

sanand0 commented 4 years ago

Thanks, @imoore76

I've merged and released 0.2.1 on PyPi

FeehGb commented 4 years ago

What if I need the old behavior ?