The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

XML compares to databases?

I have read in an article on alistapart.com that XML would be better compared to Databases than to HTML. Though I've read the article twice, I still can't figure out why (probably because I know next to nothing to both XML and Databases). Can anyone explain me how it is so?

HTML and XML share a common ancestry - they are both subsets of SGML - but they have completely different purposes.

The point of XML is to provide a self-documenting, human-readable, cross-platform way of storing data (not presentation), and so it probably is best compared with databases. In contrast, the emphasis of modern HTML is on presentation, not data/content - although this is not how Tim Berners-Lee, creator of the WWW originally intended it to be used.

SQL is a query language. It allows you to store many similar records and sort through them quickly. This will be how more and more data will be stored in the future.

XML is a data markup language. When used properly it can be used to transfer data between two computers in a language readable by both computers yet still understandable by humans. This will be how the webserver and other devices access the data in the future.

HTML is a display markup language. It is designed to take information and make it presentable to humans. However when you make it readable to humans, the computer cannot read it. This under XHTML will continue to be the way it is displayed to people in the future.

All three serve their part.

Common uses of XML today include RSS which enables you to get newsfeeds on your site from many companies like Moreover.com. You then transform this XML into a presentable format like HTML so people can read it.

In the future XML will make it easier to share data among sites and other computer systems where there doesn't have to be human involvement. It will also be able to create meta-databanks for searching. Just like today's meta-search engines, if retail sites settle on a XML schema to describe their products in the future you will be able to search hundreds if not thousands of shoe stores for all "Size 9 Extra Wide Nikes" and sort it by price. You can then choose the one best for you. With XML this is easy, without it is a lot more difficult and requires multiple databases of information.

Combine these technologies together and with Databinding (in the browser) and you can create comprehensive applications that will actually make it easier to shop online. Just imagine if you ran your own eStore and could offer competitor's prices using their own databases and available XML files?

If you think about it, all a SQL database consists of is a bunch of text files stored in binary format with a separate index that allows you to point to the right data quickly.

The whole point of XML is not to allow searching but to present data to multiple devices and allow the data to be displayed in a way the device can handle it. This means the same data can be shown in a web browser, on your PDA, your digital car radio, the printer and more without creating special pages for each device.