Dress up your XML sitemap
To convert XML into something human-readable, think of the 3-tier environments; database / application / presentation.
To explain a bit further, we have data (the xml). Granted it’s not a brand-name database like Oracle, or MS-SQL or MySQL, but it’s structured data nonetheless.
The Application layer is done using XSL’s. An XSL is an xml-stylesheet. Sometimes they’re called XSLT’s (same thing). It’s really the file that controls the layout and structure and business rules between the XML-data and the Presentation.
The Presentation is typically done with CSS. CSS is also capable of position and layout, but at the time XML/XSL/CSS were invented, CSS was best left to fonts, colours, and sizes. Basic stuff.
So, often people will cram style into the XSL for simplicity. Here’s an example. We’re familiar with the structure of XML-Sitemaps. It’s a very simple XML document with , , , and
(RSS files are also very similar, just different labels). An example could be:
<loc>http://www.whatever.com/</loc>
<lastmod>2008-06-18T17:31:47+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.3</priority>
Now structure the basic XML with a XSL file and transform each element into HTML.
So, part of the XSL might look like this:
Here, that simple business logic to transform the
0.2 XML value into a more visual “20%”
To join it all up, there’s a number of options. The easiest is to simply write a reference to your XSL at the top of your XML. Here’s my sitemap as an example:
http://www.whatthefarq.com/sitemap.xml
Normally, sitemaps look like this … not very human-readable:
But by adding to the top:
I can transform the RAW XML into something pretty. Given more time and energy, I could incorporate brand elements like site structure and navigation into the XSL and it could mirror the look of my site perfectly! Does anyone have time and energy I can have?

