Web Design & Development

[ Web Design & Development Topics ]

Extensible Markup Language (XML)

What is XML?

XML was designed to describe data and focus on what data is.
HTML was designed to display data and focus on how data looks.

XML is a document processing standard proposed by the W3C (World Wide Web Consortium) for dynamically generated content. "XML is a meta-language that allows you to create and format your own document markups [Note:  A markup language is a mechanism to identify structures in a document]. With HTML, existing markup is static. <HEAD> and <BODY> for example, are tightly integrated into the HTML standard and cannot be changed or extended. XML, on the other hand, allows you to create your own markup tags and configure each to your liking: for example, <HeadingA>, <Sidebar>, or <Quote>, or even <ReallyWildFont>. Each of these elements can be defined through your own document type definitions and stylesheets and applied to one or more XML documents. Thus, it is important to realize there are no ‘correct’ tags for an XML document, except those you define yourself" (Spainhour & Eckstein, p. 125).

Here is how it works, as described by Webdeveloper.com, "an XML page is handled by the XML-capable browser, which, using an XML parser, discovers the styling format for the page by looking it up a special style sheet, or XSL. The parser then displays the XML data in a format specified by the XSL style sheet."

Web Developers Virtual Library gives a summary of XML and XSL and how it compares to HTML, "'XML is a language for creating markup languages that describe data,' wrote Mike Edwards of Microsoft. In contrast to HTML which describes document structure and visual presentation, XML describes data in a human readable format with no indication of how the data is to be displayed. It is a database-neutral and device-neutral format; data marked up in XML can be targeted to different devices using Extensible Style Language (XSL). Since XML is truly extensible, rather than a fixed set of elements like HTML, use of XML will eventually eliminate the need for browser developers and middleware tools to add special HTML tags (extensions)."

The main difference between XML and HTML

In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data.

Drawbacks:

XML Can Help You Share Data

In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet.

Since XML is stored as plain text and is user defined, it provides a software and hardware independent way of sharing data. It can be accessed from various applications and devices. This makes it much easier to create data that different applications can work with. It also makes it easier to expand or upgrade a system to new operating systems, servers, applications, and new browsers

Converting the data to XML can greatly reduce this complexity and create data that can be read by many different types of applications.

Storing Data

When HTML is used to display data, the data is stored inside your HTML. With XML, data can be stored in separate XML files. This way you can concentrate on using HTML for data layout and display, and be sure that changes in the underlying data will not require any changes to your HTML.

XML data can also be stored inside HTML pages as "Data Islands". You can still concentrate on using HTML only for formatting and displaying the data.

Learn more: