Cheedoong / xml2json

A header-only C++ library converts XML to JSON
MIT License
299 stars 100 forks source link

[feature-request] json2xml #14

Open riccardolardi opened 7 years ago

riccardolardi commented 7 years ago

Could this also be used to parse JSON into XML?

shreyasck commented 5 years ago

Hi

I am also in search of JSON to XML parse example, in StackOverflow they mentioned we can use this library to do so, (i mean JSON->XML). several level datatype(signed, unsligned, double ect..) identifications and work around needed in the parsing process. so its clear that c++ can't handle such process.

kindly if you have any inputs on this it would save my work.

TIA

jbmonroe commented 5 years ago

I'll pick up this thread when I get to the office. (It's the desk right next to this one. A two-meter commute!) I can provide guidance, but I can't provide code directly due to IP restrictions.

You'll need https://github.com/open-source-parsers/jsoncpp. This library and JsonCpp get along well.

jbmonroe commented 5 years ago

Okay, it goes a little something like this. Anything I don't detail explicitly I leave as an exercise in reading the JsonCpp documentation, but none of this is difficult. Writing it recursively removes most of the complexity.