Should XML be used server-side, and JSON client-side?

Posted by Michel Carroll on Stack Overflow See other posts from Stack Overflow or by Michel Carroll
Published on 2010-05-13T19:20:13Z Indexed on 2010/05/13 19:24 UTC
Read the original article Hit count: 233

Filed under:
|
|
|

As a personal project, I'm making an AJAX chatroom application using XML as a server-side storage, and JSON for client-side processing.

Here's how it works:

  1. AJAX Request gets sent to PHP using GET (chat messages/logins/logouts)
  2. PHP fetches/modifies the XML file on the server
  3. PHP encodes the XML into JSON, and sends back JSON response
  4. Javascript handles JSON information (chat messages/logins/logouts)

I want to eventually make this a larger-scale chatroom application. Therefore, I want to make sure it's fast and efficient.

Was this a bad design choice? In this case, is switching between XML and JSON ok, or is there a better way?

© Stack Overflow or respective owner

Related posts about php

Related posts about JSON