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!
Download
Because I know you want your own XML sitemaps to look this good too, I’ll release my XSL stylesheets here:
XSL stylesheets for XML Sitemaps
Usage
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!


Hi,
I am currently in the process of putting together a video sitemap but have a couple of questions:
1) If you have the same video on a couple of URLs do you have to do a reference for each URL or is is acceptable to put several URLs in one reference?
2) What do you put as the URL if the video is part of a macro that is placed on several pages as a result of being copied across from the CSS?
Thanks
1: pick one URL and go for that, don’t host the same video on multiple pages, especially not for Google.
2: I don’t get this question :)
Nice work Joost!
Emma, Like Joost said for 1,2) it is not a good idea to host your video on multiple pages, if you have to to do it, then just pick one URL regardless of the macro.
Thanks, I desperately needed this info!
Thanks Yoast, it looks great.
Any idea when your WordPress SEO Plugin is going to be finished and released to the public?
That’ll take a couple of months :)
Cool. Just one more question. If I am running thesis would your plugin provide an edge over the built in SEO functions that are coming with the thesis theme ?
Yes.
That plugin is desperately needed – to many separate plugins right now to do these functions: one for URLs, one for Video, etc
Bring on the plugin Joost!
Cool, just what I am looking for. Keep up the good the work
Thanks for the style sheets. These will be a much needed addition to my sitemaps. Not only for me but also for my clients. It’s always good to show them what you’ve created, for something like a video sitemap, in a good format. Thanks!
I’m really looking forward to this SEO plugin and I’m excited to hear it’s going to be more of an all exclusive plugin with sitemaps included. That will make my life a little easier installation.
I am a fan of yours, I used almost all your plugin and been waiting for your SEO Plugin…
This one also is good…
Joost,
I am having such problems submitting my site map. I think I do it exactly as indicated but always seem to get an error. I am not an idiot. Please tell me when you release a plugin I am getting dishearten with trying to make any money online.