Monday, August 31, 2009

What is XML and What Good is XML?

What is XML?
XML stands for eXtensible Markup Language and is a descendant of Standard Generalized Markup Language (SGML), just as HTML is. The most noticeable difference between XML and HTML is the fact that you can define your own tags in XML. That is why XML is considered an extensible language. Because of the freedom of the tags, however, the way in which XML must be written is very strict. Every tag must have a closing tag and all nodes must be ordered properly. If any of these rules are broken, an XML document will simply fail to function. HTML, as many have found, will work even if the document only vaguely looks like an HTML document.

What good is XML?
XML is all about structure. The markup in XML defines what the data represents (i.e. The Catcher in the Rye). HTML, on the other hand, is made for publications. Hence, in HTML, it makes sense to order information by where and how it will appear on the screen. In XML, however, the structure of the information is what's most important. The order of the information is unimportant - it can be displayed in whatever order you want. The important thing is that each piece of data is contained in markup that describes what that data really represents. The structure can be maintained much more easily in XML because of the fact that you can create your own tags.

Think of a book you've read recently. The chapter titles were most likely in bold print. We come to rely on these sorts of conventions to give us a sense of the structure of the document. When you're dealing with a web page, you have to make the structure evident to the reader to help them deal with the information. By using XML, you can easily keep track of information like chapter titles because they will all be contained in markup designating what they are (i.e. Ch. 1 - The Beginning). You can then choose to display that information in whatever way will make it easiest for your reader.

That's what XML is all about: structure.

0 comments:

Popular Posts

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP