1. Technology

Who Uses XML?

XML Has Many Uses

By

Everyone seems to be talking about XML these days, if it's not Ajax, it's some other tool that uses XML as the back-end, but what are people actually using XML for? It's one thing to learn how to use XML, but what for? Here are some common uses for XML on the web right now:

  • web development
  • documentation
  • database development

XML in Web Development

In a way, you could argue that this is the most widespread use of XML, as XHTML. Because XHTML is simply HTML 4.0 reworked, many HTML 4.0 sites are actually using an invalid form of XHTML.

But the benefit of XML is not that it already exists as XHTML, but that you can create web documents from XML using XSLT to transform your documents into HTML. You can then send your XML to an XSLT processor on the web server and serve that result to the web browser. This makes your documentation available in whatever format you need it to be in.

XML and Content Management

Ironically, with most websites that use XML, the web designers and content developers might not even know that XML is there. This is because there is generally a CMS or content management system that sits in front of the XML to make it easier for the content writers to write their web content without worrying about how to write HTML or design web pages.

XML and Documentation

Many companies are moving to XML to write their internal documentation. The most common XML platform for this is DocBook. The advantage of XML for documentation is that it can be used to define the common traits in books, magazines, stories, advertisements, and so forth. And DocBook already has that type of information defined.

The best thing about XML for documentation is that the XML is easy to understand for humans, both of the actual documentation, but also the XML code surrounding it. XML can be used for any type of documentation, from a publishing house to Marketing materials.

Here is an example of documentation written in XML:

<howto>
  <title>How to Write a Mail Link</title>
    <author>Jennifer Kyrnin, Web Design Guide</author>
    <description>
      <paragraph>
        Use a HTML tag to allow your readers to send email directly from your Web site.
      </paragraph>
    </description>
    <directions>
      <step>Write a link as usual <a href="">email me</a></step>
      <step>Where you would normally put a URL, put the code "mailto" <a href="mailto:">email me</a></step>
      <step>Then put your email address after the colon <a href="mailto:html@aboutguide.com">email me</a></step>
    </directions>
</howto>

As you can see, both the data and the XML are readable and understandable. The content is also in an order that would be expected by a human reading the document.

XML and Database Development

Databases are a natural use for XML, because XML is all about data. Unlike XML for documentation, XML for databases does not need to be readable by humans. The data is simply written in such a way to allow machines to read it and make it accessible to a database.

Here's XML that might be loaded into a database:

<item number="00001">
  <name>
    <first>Jane</first>
    <middle>Q</middle>
    <last>Public</last>
  </name>
  <phone type="voice">
    <areacode>407</areacode>
    <number>555-1212</number>
  </phone>
  <phone type="fax">
    <areacode>407</areacode>
    <number>555-1213</number>
  </phone>
  <email>jpublic@gmail.com</email>
</item>

Unlike the document XML, it's not necessary that this be easily readable by humans. Since it is meant to be input into a database, it is only important that it be processable by a computer.

XML is used by many companies for many different reasons. Here are some interesting uses:

Most Recent Articles

  1. About.com
  2. Technology
  3. Web Design / HTML
  4. XML
  5. Who Uses XML? - Common Uses for XML on the Web

©2014 About.com. All rights reserved.