Debugging your XML sitemap with an XSL Stylesheet
When you’re developing XML sitemaps, no matter on what platform, it’s pretty hard to debug them sometimes to be proper XML. You have to validate all the time and you can’t do a quick “glance” over to see whether your sitemap has the URL’s you were expecting.
As mentioned before I’m working on my WordPress SEO plugin, and it’ll do sitemaps, three kinds of sitemaps actually: video, news and normal. For all three of them I’ve developed so called XSL stylesheets, so I can quickly glance over a sitemap and get an idea as to whether everything I expected to be in there is actually there. An XSL stylesheets transforms an XML document into HTML output, for instance, for a normal XML sitemap, that looks like this:
And for an XML video sitemap:
Especially with the recent addons to the sitemaps protocol (check out the image count in the first “normal” sitemap for instance), this makes it a lot easier to see if you’re doing things wrong. On top of that, using some jQuery, the headers are sortable!
Because I know you want your own XML sitemaps to look this good too, I’ll release my XSL stylesheets here:
Usage of these XSL stylesheets is easy, just add a line like this to the top of your XML output:
<?xml-stylesheet type='text/xsl' href='/url/to/xsl-stylesheet.xsl'?>
Let me know whether you like this, and what you’d like to add to these XSL stylesheets!