Jump to content

Purpose of XML


dhpd22

Recommended Posts

Hey guys,I am very confused, what is the purpose of the XML files. And why we need web information in XML format.I studied a forum here, the forum says that XML is a database. But why we need the web site's information as a database.Plese help! :) Dheeraj

Link to comment
Share on other sites

For the same reason you need an information in any kind of database, like MySQL for example. To re-use a piece of data multiple times over, applying it different presentation each time, or simply calling it on more then one time on a single platform.I thought you understood me the last time. Oh well...A more real life example. You have a menu at your site. Let's say it you have "Home", "Products" and "About". Your site has 1000 pages. In a static environment, each page might look like:

<html><head>...</head><body><div id="menu"><ul><li><a href="/">Home</a></li><li><a href="/Products">Products</a></li><li><a href="/About">About</a></li></ul></div><div id="main">...</div></body></html>

Now imagine that you want do add a "Links" menu. Do you really want to go over 100 pages and add the new menu to each one? No, you don't.At that point, many will suggest SSIs (Server Side Includes), which is a good start for the unaware and is appropriate for the situation above. However, imagine that the menu is quite larger and even has submenus for the sake of usability. Let's say there are 30+ links there. Adding or removing a single one is easy with SSIs, but what would you do if let's say, the path to a certain group of items changes. You would have to edit every single occurance of the old path to the new one. With a database driven site, you can only modify one path, so that everything that uses it will now use the new path.It's all for the sake of flexibility. The ability to influence on multiple platforms is also to be mentioned. You edit one data and everything that uses it accepts it automatically.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...