An Introduction to XML - Reasons to Use XML (Page 2 of 4 )
So now that you know a bit of the background of XML, the only real question left is why should you use it? To start with, it's extremely easy to learn and the specification for it is extraordinarily small, which means it is portable and very fast. It can be used as a kind of data store with HTML used to present the data. This makes updating your site easier; you can just update the stored data and these changes are reflected in your web page instantly.
It supports the HTML linking specification, but also contains its own, more powerful linking specification XLINK, and XPOINTER. Similarly, it can be presented using CSS styling, but also comes with its own style implementations, XSL (eXtensible Style Language) and XSLT (eXtensible Style Language transformations).
Possibly the best reason for using it is that it is a meta-markup language, which means that it can be used, fundamentally, to create new mark-up languages. The power of this feature is phenomenal and provides almost limitless applications of the language. Are you convinced yet? Good.
Two Types of XML Documents
Before we create an XML document of our very own, one more thing to note at this point is that there are two types of XML documents: valid documents and well-formed documents. Every XML document needs to be well formed but not every document needs to be valid. To expand on this: a well-formed document conforms to the syntax and rules of XML; if it does not do this, it will not work. But in order to be a valid (or validated as the correct term goes) document, it must contain either an internal Document Type Definition (DTD), reference an external one or a combination of both. For future reference, internal DTD's take precedence over external DTD's. If you donít know what a Document Type Definition is, don't worry, I'll cover this shortly.
One point to make at this, er, point, is that XML is a lot stricter than HTML in its syntax, which fits in nicely with one of the design goals. For one thing, every tag must have an end tag, including empty tags.