Introduction to XML

Description: HTML, XHTML, XML? it's easy to get caught up and confused with all the different abbreviations and acronyms flying around in the world of web development. But it's worth finding out more about XML if you are intending to start building your own web pages.

XML - otherwise known as Extensible Markup Language - might not help you write your code, or even tell you how it will look on the finished page, but it will help you to get it there.

If you are thinking of making inroads into web development and programming then you will want to know what XML is and how it works. Firstly it's important to understand that it isn't a mark up language itself, even though its name might well lead you to believe that. Instead it defines the language you are using to create your document, which could be HTML.

By learning and using XML you will eventually be able to use HTML more effectively as well, as XML will help you structure that language more accurately.

You could think about XML as being a go between that sits in between your computer and the HTML you are writing, that will eventually lead to a page being displayed on your computer. The XML effectively knows what the HTML document is all about, and it makes sure that the computer knows exactly what it's about as well. This ensures that no unfortunate errors occur as a result of the content of that HTML document being misconstrued in any way.

Once you start reading up about XML and finding out more about it, you will notice that one particular word keeps cropping up from time to time. That word is ?parser'.

So what exactly is a parser, and how does it relate to XML?

Put simply, a parser is a computer program which has a defined purpose. Its purpose is to split a large chunk of data into the separate parts which comprise it. So for example, it might split a book into its separate chapters, or a box of Christmas crackers into twelve individual crackers.

That's all very well, but what function does that serve? Well, by breaking down that large chunk of data into its separate elements, it ensures that the computer understands what is being given to it.

Now since parsers are used in conjunction with XML, we can see that the parser breaks down content into its composite parts, and the XML then tells the computer about those parts, instead of telling it about a huge chunk which it could then misinterpret.

XML is, in essence, all about clarity. While you could do without it, you will find life much easier to know about it if you design and build websites on a regular basis. It saves errors from being made and leads to a better quality website.

Think about what happens sometimes when you search for something on Amazon, or a similar site. You enter your keywords and click your mouse, expecting to see the exact products you're looking for. You will get them, but you'll also get a few odd items that don't seem to bear any relevance to what you looked for.

Now imagine your search is your HTML document, and Amazon is the computer. If XML and parsers were used, those irrelevant searches probably wouldn't show up at all, because the computer would understand exactly what you were looking for.

So while XML may sound complex to begin with, it can lead to greater clarity in the long run.

Copyright © 2007-2011 Business Hosting Provider. All Rights Reserved.