The new generation of Microsoft Office products and even the next Windows itself are heavily based on XML and consequently both will focus heavily on promoting its use to do various things. So, if you haven't wised up to it yet, this is your chance to demistify the monster and finally learn about what the hell is XML.
XML sounds more scary than it really is. It stands for eXtensible Mark-up Language, which just really means "a mark-up language that you can customize whichever way you want." And that pretty much defines everything XML is.
A mark-up language for those who are not familiar to the term is a programming language made of tags that you can use to, well, tag text, effectively telling the computer to interpret things in a certain way. Tags are made of angle brackets. The < symbol opens a tag, and the > symbol closes a tag.
Most mark-up languages will give you a pre-defined set of tags that you can use to mark up your text in a certain way. For instance, in HTML, if you wrap text around the b tag, that is, for instance, <b>some text</b>, you are telling the computer to make that text bold.
Now this is where XML presents its peculiarity and where the "extensible" adjective of its title fits in. XML does not have any pre-defined tags (well, almost)! That's it, you create your own tags and use it whichever way you want to use. So, in XML, there is no <b>tag for bold or anything of the sort. There could be if you want, but you could make that tag be called <iwantthisbold>if you want.
So, first lesson learned: XML is extensible, that is, fully customizable by the user.
Now for a second and very important lesson: XML is only data and nothing else.
Unlike HTML which provides an library of pre-defined tags which produce specific results, such as using the b tag for making text bold, XML tags do not have any meaning, they don't achieve anything. XML is just data, what you do with it is up to you. So, for instance, if you add write a tag named <IWantThisBold> the text will only be bold if the program that reads your XML decides to make it bold. So, XML is only as good as the program that interprets it.
This raises a question: Couldn't I just mark-up my text, say, with percentage signs and then feed to a program that understands that as bold? If XML doesn't do anything by itself why do I need to follow rules such as encapsulating my tags with angle brackets? Well, you could. There is nothing stopping you from doing so, however, you would have to write your own programs to understand that specific format of mark-up you came up with. See, the beauty of XML lies in its rules. That is because in a way, XML is just a standardized format of mark-up which makes it widely acceptable by any programs out there. So be it Word, Excel or the Gimp, if they want to accept XML they know what to expect. XML is almost like a widely accepted contract of mark-up formatting.
Let's look at an example of an XML document:
<? xml version="1.1" ?>
<Books>
<Book>
<Title>The Da Vinci Code</Title>
<Type>Thriller</Type>
<Summary>John Langdon sets out to solve an ancient</Summary>
</Book>
</Books>
As you can see, the immediate characteristic of an XML document is that it's pretty self-explanatory. No one needs to tell you what this document is trying to achieve. It's a file that provides a list of books. Moreover, it's intuitive. It doesn't take any research or technical knowlege to guess what you would have to do if you wanted to include another book on that list.
So that is the mystery of what is XML solved.
As you can see, XML only sounds fancy, but it's actually really simple and nothing to be afraid of.
Of course, things can get pretty complex, but you don't need to get involved with the complexities surrounding XML unless you really want to. Anyone can write XML files and that is, in fact, the whole point of XML: easy information sharing.
Stay tuned on this blog for more on XML!