node-xml icon indicating copy to clipboard operation
node-xml copied to clipboard

Convert both ways.

Open reggi opened this issue 13 years ago • 12 comments

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.

reggi avatar Aug 31 '12 21:08 reggi

I would agree...

TooTallNate avatar Jan 06 '13 00:01 TooTallNate

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.

dylang avatar Feb 28 '13 03:02 dylang

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.

tc avatar Oct 10 '13 19:10 tc

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

halfdan avatar Mar 10 '14 15:03 halfdan

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.

dylang avatar Mar 10 '14 16:03 dylang

Do One Thing Well™

talon avatar Jan 07 '15 00:01 talon

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

buschtoens avatar Jan 07 '15 00:01 buschtoens

I agree the name is misleading.

talon avatar Jan 07 '15 02:01 talon

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

ralyodio avatar Mar 29 '15 07:03 ralyodio

+1

caiosm1005 avatar Dec 08 '16 21:12 caiosm1005

I find the name misreading too. You should at least have a notice saying that it only encodes data in the readme

KaidenP avatar Mar 08 '17 23:03 KaidenP

Yeah this lib should not really be named node-xml unless it can do everything the name implies. Too late to change it now though.

ozyman42 avatar Aug 06 '23 00:08 ozyman42