How to convert xml to json in c#?

Why haven't Enterprise Web Applications replaced the xml files used by them with the corresponding json files?

  • I have read a lot about how json files are more lightweight and has  significant advantages over xml files while parsing etc.. Why do enterprise app developers continue to use xml files instead of json for coding their business logic.

  • Answer:

    The XML files are only parsed a few times during configuration. There is no compelling reason to switch them to JSON. JSON schemas don't seem to have taken off. Configuration files need strong validation.

Miguel Paraz at Quora Visit the source

Was this solution helpful to you?

Other answers

Simply re-working everything to use JSON instead of XML gains nothing and could be a net loss. They aren't semantically interchangeable, and as says, there is no real validation or schema story for JSON. XML is more likely to be challenged by the techniques mentioned in  .

Toby Thain

With JavaEE6, there are web based specifications such as jax-rs, CDI and servlet3, which allow you to configure via annotations. In many cases, you can have EE apps with zero XML files. CDI Tutorial: http://docs.oracle.com/javaee/6/tutorial/doc/giwhb.html JAX-RS: http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html As others mention, one of the benefits of XML right now from configuration perspective is schemas and associated schema validation, which is huge for enterprises.

Anil Saldanha

I think a better question might be why the JEE folks still don't seem to be starting from Java APIs, and then - maybe - building configuration DSLs on top of that.

Eelco Hillenius

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.