PDA

View Full Version : PHP and XML



d-machine
07-16-2008, 09:33 AM
Hi

What are the advantages of working with XML and not with regular databases?

I'm a bit new to it and I consider learning it..

Jesdisciple
07-16-2008, 03:05 PM
Any programming language can read XML without a middleman. A database must be read by SQL and a server language (e.g. PHP), which can be acting as a middleman for JavaScript. XML is also more flexible than a database, but (I believe) at the expense of efficiency.

In an old project of mine which I still intend to finish, I need the app's configuration data available to all the arms. As I recall, it has 3 arms: JavaScript; the server language; and the server's operating system. I decided to use XML to keep track of the configuration, even though the app's ultimate data is stored in a database.

d-machine
07-16-2008, 08:10 PM
thank you

dicegame
07-17-2008, 07:34 AM
I use XML so that multiple languages can access the data quickly - which is why it was created.

Jesdisciple's explanation was great. :)

codeexploiter
07-17-2008, 08:20 AM
What about JSON (http://www.json.org/) which is lighter than XML?