XML versus the Database

Nope, this isn’t tonight’s featured bout at the World Wresting Federation. It’s a discussion stemming from one very basic question: What truly is the difference between storing information as XML and storing it in a database?

In the broad sense, there isn’t much. After all, both are technologies designed to impose structure on raw data, thereby making it more useful to the applications that need it. XML accomplishes this with elements and attributes, a database with rows and columns. Both also come with some fairly powerful tools—databases with Structured Query Language (SQL) or some variant thereof, XML with the XML Path Language (XPath), and Extensible Stylesheet Language Transformations (XSLT)—that facilitate the manipulation ...

Get XML and PHP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.