Converting WordPress Export XML to HTML

WordPress implements an Export function which allows bloggers to download the contents of their blog as a single XML file.

Based on my previous work in dbscript to generate an HTML documentation of a database schema using XML and XSL I modified the “Single HTML” XSL of dbscript to create an XSL to transform the WordPress Export XML into an HTML page.

This HTML page lists all article titles with dates, categories and link to the original URL in the blog.

Clicking the article’s title will expand the list to display the contents of the selected article.

To display paragraphs properly, I needed to replace newlines with <br /> elements, as described on this page implementing various replace operations in XSL.

The WordPress HTML XSL file is available for download here.

7 Responses to Converting WordPress Export XML to HTML

  1. […] a previous post I described an XSLT file to convert the exported XML into a single HTML file. A click on an […]

  2. […] program is based the two XSL style sheets I created earlier to process WordPress XML Exports: the “Single HTML” XSL and the “Table of Contents” […]

  3. netocc says:

    Thanks a lot. You just made my day.

  4. Marcus Downing says:

    The site you’re hosting the file one required login… and the ‘New Account’ link goes to ‘Page Not Found’.

    Is there any chance you could put the file somewhere it can be downloaded?

  5. devio says:

    The .xsl file is now part of the application wpxslgui (
    Go to to download it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: