Jump to content

XML or JSON?


GuyBri89

XML or JSON?  

4 members have voted

  1. 1. Which one?

    • XML
      4
    • JSON
      3
    • Neither
      1


Recommended Posts

I've slightly edited your poll now that it's still early (with multiple choices, you don't need the option "both").I use both... and others. Each mechanism has its place. JSON is best used as a communication between XMLHttpRequest and the server, though I've seen it used as a DBMS mechanism. XML is best used for a custom language creation, should a language for what you want to do isn't present. There's also SOAP, an XML based language, best suited for cross-language server-to-server communication, though any of the other mechanisms could be used for the same thing. There's also plain text, best suited for a specialized infrastructure where you desire maximum efficiency and have full control over all nodes involved.

Link to comment
Share on other sites

Agreed, both are useful in their own contexts.JSON has the advantage of extreme compactness. It structures data without adding a lot of overhead. I think it is ideal when you need to transmit data to/from a database.XML is an excellent alternative to a database for some applications. It can be used for storage and transmission. If your AJAX application stores data on your server in XML format, and the file is relatively small (under 100K), then it can make sense to transmit the whole file directly from your server with no server-side processing. Let the browser extract/write data from the XML as a JavaScript DOM object. The XML can be returned to the server without additional parsing and saved immediately to a file. That is how I typically use XML in an AJAX app.

Link to comment
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...