Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Convert both ways. #5

Open
reggi opened this Issue · 10 comments

8 participants

@reggi

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.

@TooTallNate

I would agree...

@dylang
Owner

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
tc commented

The less ideal solution is to use 2 libs: xml for json to xml and https://github.com/Leonidas-from-XIV/node-xml2js for xml to json converting.

@halfdan

@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 :/

@dylang
Owner

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.

@LegitTalon

Do One Thing Well™

@buschtoens

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().

@LegitTalon

I agree the name is misleading.

@chovy

+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
Something went wrong with that request. Please try again.