Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple XSLT transform to extract post dates and titles from a WordPress export file
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wp="http://wordpress.org/export/1.2/"
version='1.0'>
<xsl:output method='text' encoding='utf-8'/>
<xsl:template match="/">
<xsl:apply-templates select="/rss/channel/item[wp:post_type = 'post']"/>
</xsl:template>
<xsl:template match="/rss/channel/item">
<xsl:value-of select="wp:post_date/text()"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="title/text()"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.