Convert both ways. #5

reggi opened this Issue Aug 31, 2012 · 10 comments


None yet

8 participants


This is not a criticism of your work, its great, but just something I don't understand. I'm so confused as to why when someone develops a JSON and XML converter that they don't create the other conversion. So all the community has a JSON to XML parser and a XML to JOSN parser that don't work together. Do you know of any interchangeable parsers? Your library on npm is just xml and it should really be the one that does both.




I would agree...


Great point!

When I built this it seemed like a much easier undertaking than parsing XML. I'm happy to accept review and accept PR for converting arbitrary XML to this project's JSON format.

tc commented Oct 10, 2013

The less ideal solution is to use 2 libs: xml for json to xml and for xml to json converting.


@dylang Is there any work put into this? This library is a lot more compelling to use than node-xml but lacks the ability to parse xml sadly :/


I'm not planning on creating an xml parser. I think it would be best to use separate package that's already good that doing that because of the complexity, but I'm happy to accept a pull request that "bridges" this module and a parser to make it trivial to go back and forth.


Do One Thing Well™


Do The Things You're Named After™

Do One Thing Well™ would apply if this was named xml-encoder or something similiar. Since this package squats only has the name xml one would assume it does both.

Just how JSON has JSON.stringify() and JSON.parse().


I agree the name is misleading.


+1 for converting back to json. I need to compare the outputted xml to inputted json in my unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment