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
- database development
XML in Web Development
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:
<title>How to Write a Mail Link</title>
<author>Jennifer Kyrnin, Web Design Guide</author>
Use a HTML tag to allow your readers to send email directly from your Web site.
<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:email@example.com">email me</a></step>
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:
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:
- Golfing: GolfML
- Aerospace: Spacecraft Markup Language
- Music: Music Markup Language
- Banking: Bank Internet Payment System
- Advertising: AdXML
- Engineering: LandXML
- Oil: PetroXML
- Artificial Intelligence: AIML
- eBooks: FictionBook