GuyBri89 Posted June 23, 2011 Share Posted June 23, 2011 I just wanna know which one you use, or if you use both.I know XML can be used with PHP for a tiny DBMS, but can JSON do the same thing? Link to comment Share on other sites More sharing options...
boen_robot Posted June 23, 2011 Share Posted June 23, 2011 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 More sharing options...
jeffman Posted June 23, 2011 Share Posted June 23, 2011 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 More sharing options...
DirkTD Posted August 3, 2011 Share Posted August 3, 2011 i dont know what JSON is, so voted XML Link to comment Share on other sites More sharing options...
jeffman Posted August 3, 2011 Share Posted August 3, 2011 Seriously? You actually dug up a month-old thread just so you could cast a vote based on your own lack of knowledge? Seriously? Link to comment Share on other sites More sharing options...
DirkTD Posted August 3, 2011 Share Posted August 3, 2011 ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm... yes?(where can i find a tutorial) Link to comment Share on other sites More sharing options...
jeffman Posted August 3, 2011 Share Posted August 3, 2011 JSON Link to comment Share on other sites More sharing options...
DirkTD Posted August 4, 2011 Share Posted August 4, 2011 never noticed it was on the website but thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.