Saturday, October 31, 2009

XML for Dummies

XML


XML: extensible markup language. It's a different language. Different from HTML,hyper text markup language. HTML focuses on describing how a Web browser should display images and text on the screen. It merely serves as a way to format the information on the page that is presentable to users.There is no meaning to the browser what the elements (images and text) represent. Users infer the meaning based on the context of the elements. If numbers appear on the screen that follows a date type format, then they recognize it as a date. To the browser, it is just numbers separated by slashes.

XML is a means to replace HTML. It is a language that is designed to be structured, with meaning, while allowing for data exchange. How would XML replace HTML? There are 2 file types. First, there is the XML file. This file defines the elements within the page. There is so much information out there in the interwebs, how do we define everything? XML allows for data modeling with the Document Object Model (DOM). In conjunction with a Document Type Definition (DTD), there is now a data model and a corresponding definition for each data element. Predefined tags are used to separate the different elements and data. By looking at an XML file, one could determine the meaning of the document without having to look at the website and determining its meaning through the context in which it is placed. Elegant isn't it?! So by using a standard set by organizations with a common interest, it would be possible to share data between them, all through the content on the web site.

Because XML focuses on the meaning of data and elements, it does not touch upon the visual aspect of how such information is displayed on a web page. To remedy this, one must use a stylesheet. The Yang to XML's Ying is the eXtensible Stylesheet Language (XSL). The XSL document defines the rules for displaying an XML document's data on the web browser. With the power of the two working together, one is able to replace a merely visual interpretation of a web page with a more meaningful and data rich document.

No comments:

Post a Comment