XML is Coming to Your Administrative Toolbox - Page 2

 By Carla Schroder
Page 2 of 2   |  Back to Page 1
Print Article

Continued From Page 1

Why You Need To Care
XML provides a common, cross-platform data exchange format. And because it uses plain text files the data are recoverable with simple tools, or even plain eyeballs. XML is in wide use these days — it's the default file format for OpenOffice, Gnumeric, Abiword, KOffice, and many other applications. Using a structured, machine-readable format means all manner of tools can be written to read and manipulate the data: export to different types of presentation formats, make large changes with small effort, and export to different applications.

OS X, GNOME and KDE all make extensive use of XML. This makes for faster, easier development and configuration of GUI interfaces. Contrast these with Webmin, which is a general-purpose Web interface for configuring Linux servers and applications. Every module must be custom-written for each individual application. Webmin is Perl-based, because only Perl can handle the parsing nightmare that characterizes the Linux/Unix configuration file universe. An additional advantage of Webmin is that you can apply manual edits and Webmin won't overwrite them. This is not true of many GUI configuration tools, as users of Red Hat, Mandrake and SuSE know. Using well-designed XML configuration files should make this sort of silliness a thing of the past.

Using XML opens up all sorts of possibilities: more accurate syntax checkers and markup validators, easier parsing and analysis of logfiles, easier customization and replication, easier scripting, easier reporting, and better cross-platform integration. In a nutshell, making the computer do more work and the human do less is a good thing.

XML Advantages
Sure, as hardworking system and network administrators the last thing we want to hear is "hey, here's another new technology to learn!" But XML isn't so difficult. It's a markup language that looks similar to HTML, with a major difference: In XML you can define your own tags. This gives you the flexibility to design a document however you need to, and being able to write descriptive tags makes a document more understandable. So you can almost make your files self-commenting.

For example, a common convention in a typical Linux configuration file is to use spaces and order functionally:	localhost	localhost.localdomain	windbag          windbag.kewldomain.net
If you forget and use a comma, or get your options in the wrong order, it won't work. With XML you can explicitly define each element:

<?xml version="1.0"?>
< hosts>
< localhost ip="" hostname="localhost" domain_name="localdomain" </localhost>
<lan_hosts ip="" hostname="windbag" domain_name="kewldomain.net" </lan_hosts>

So you don't have to worry about how to delimit spaces or what order to put options in, and searching for specific elements is dead easy, so changes are swift and sure.

Typing rafts of tags is less than fun. Fortunately the world is overfull of XML editors to lighten the load, and of course good old Unix standbys like Emacs, Vi, Joe, and other text editors can be customized to apply tags with simple keystrokes.

Learning XML
Of course there is more to this than simply applying a few tags. You need a schema file, and any XML pages that are displayed online need a corresponding stylesheet. w3schools has an excellent online tutorial. So there is no need to fear being swept away by the rising tide of XML-formatted configuration files. And anyway there is plenty of time to get up to speed- you can't convert existing configuration files without making their applications XML-aware, so for once we have the luxury of time.


This article was originally published on Apr 26, 2005
Get the Latest Scoop with Networking Update Newsletter