locked
xml or json RRS feed

  • Question

  • User2102072086 posted

    hi,

    some body said that xhtml was intorduced to bridge the gap betwen html to xml. that meant xml is destination.

    after long time json is introduced.

    so  i would like to know what should i use JSON OR XML with respect to above two stmts.

    yours sincerley.

    Friday, August 12, 2016 1:30 PM

Answers

  • User-821857111 posted

    It depends on what you want to use it for. If you want to provide data to third parties, you can use either format. Most people seem to prefer working with JSON these days, but you could always provide both formats. There are serialisation libraries for both that makes providing both formats pretty trivial.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 12, 2016 1:46 PM
  • User-474980206 posted

    html was based on SMGL (as is xml). html was designed as a document language and xml as a data language. at one point it was popular to produce html from xml via xslt (also a smgl language).  because xslt produced proper xml, xhtml was born. xhtml being a xml grammar, could be parsed by an xml reader. this happened around the html 4.2 time frame.

    even given the advantages of xhtml (tools could parse and write it easier), it never became popular with web producers and is now a dead language (work was started on xhtml 2.0 but never completed).

    rather than make html grammar more formal, the decision was to make it simpler and cleaner. this lead to the release of html 5.   

    parallel to web pages, web services that only return data became popular. xml was the language of choice and lead to SOAP, still an important standard. but much like xhtml became too complex, as did SOAP. tools we're needed to build the code to parse and build SOAP payloads.

    as it became more popular for javascript to call web services via ajax, a simpler format than xml was desired. JSON was born and is now the most popular data format for ajax calls (javascript has native support for parsing and serializing JSON, and almost every language has a parser as it easily maps to dictionary collections).

    soon after JSON became the popular data format for ajax calls, REST became a popular api to read/return JSON (for example webapi), though form post, JSON response is probably still the most popular (for example MVC actions).

    if you are using ajax, then JSON makes the most sense. if you are exposing a web service to the internet, REST/JSON would the most popular, but SOAP is still viable (especially if using java or .net as they have the support tooling). if you are taking internal server to server using WCF then its XML. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, August 13, 2016 12:36 AM

All replies

  • User-821857111 posted

    It depends on what you want to use it for. If you want to provide data to third parties, you can use either format. Most people seem to prefer working with JSON these days, but you could always provide both formats. There are serialisation libraries for both that makes providing both formats pretty trivial.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 12, 2016 1:46 PM
  • User-474980206 posted

    html was based on SMGL (as is xml). html was designed as a document language and xml as a data language. at one point it was popular to produce html from xml via xslt (also a smgl language).  because xslt produced proper xml, xhtml was born. xhtml being a xml grammar, could be parsed by an xml reader. this happened around the html 4.2 time frame.

    even given the advantages of xhtml (tools could parse and write it easier), it never became popular with web producers and is now a dead language (work was started on xhtml 2.0 but never completed).

    rather than make html grammar more formal, the decision was to make it simpler and cleaner. this lead to the release of html 5.   

    parallel to web pages, web services that only return data became popular. xml was the language of choice and lead to SOAP, still an important standard. but much like xhtml became too complex, as did SOAP. tools we're needed to build the code to parse and build SOAP payloads.

    as it became more popular for javascript to call web services via ajax, a simpler format than xml was desired. JSON was born and is now the most popular data format for ajax calls (javascript has native support for parsing and serializing JSON, and almost every language has a parser as it easily maps to dictionary collections).

    soon after JSON became the popular data format for ajax calls, REST became a popular api to read/return JSON (for example webapi), though form post, JSON response is probably still the most popular (for example MVC actions).

    if you are using ajax, then JSON makes the most sense. if you are exposing a web service to the internet, REST/JSON would the most popular, but SOAP is still viable (especially if using java or .net as they have the support tooling). if you are taking internal server to server using WCF then its XML. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, August 13, 2016 12:36 AM