Why Should I Use XML?

Why Should I Use XML?

I recently bought a book that includes the XML specification as well as some commentary. Much to my surprise, I found that after authoring an XML document, the browser fed me tags as well as text. I discovered that you need to use XSL (Extensible Stylesheet Language) to get nice browser output. So now I am asking myself, “Why should I even use XML? What is it that XML is attempting to achieve?”


You have just discovered one of the great ironies of XML. The markup language was originally designed to provide a better alternative to HTML, by letting people create their own systematic markup language for specialized needs. On the way to the browser, two interesting phenomena settled out, however. First, most people have neither the time nor the resources to create their own markup language for documents. Second, by simplifying the SGML structure on which XML is based, it became increasingly apparent that it was a very useful tool for representing more structured data.

When I was new to XML, I did what most newcomers do when confronted with the language?I tried to create a Web page with it. I spent two days defining the underlying CSS styles, spent another day coding and debugging, and all for an article that would have taken me about three hours to write.What’s worse is that in order to be able to support functionality that I could readily duplicate in HTML, I often had to rely on such technology as IE5 behaviors, which meant that my results didn’t work in Netscape. By the time I was done with it, I asked myself exactly the same question you did, “Why did I just put myself through this malarkey? Is this really what XML is all about?”

No…it isn’t. XML extends beyond documents, and even beyond data?it is a way to describe objects. An HTML document is one kind of an object?a document that contains headers, images, tables, and forms. But because we tend to think of it as browser output, we lose sight of the fact that even the simplest HTML document, described abstractly, is a remarkably complex piece of work. For the most part, serious XML developers have backed off this document outlook (for a little while, anyway) and are increasingly looking at XML as an object description language?a way to describe the properties and property values of an entity.

For example, you could describe a purchase order as an XML document. This document would be made up of a header object that maps to the general information, and collection line item objects that describe the characteristics of each item being purchased (the product name, product code, cost, number of items purchased, and so forth):

Wiley E. Coyote Acme Rocket Co. 19990909T11:25AM
Big Boom BgBm1 129.95 12 Little Boom LtBm1 49.95 16

You can send such a structure between two XML parsers located on different machines to purchase an item. You can coincidentally use XSL, XML’s transformation language, to convert this output into an HTML table or with more sophisticated tools, turn it into a chart or load it into a component. However, this use is really secondary to the power of XML as a data transfer mechanism.

The books that are currently out on XML are shifting away from the document-centric viewpoint and moving toward a data-centric one. I would recommend IE5 XML by Wrox Books as a good introduction to data-centric XML, though obviously it is geared toward Microsoft’s implementation of it.

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as