Skip to content

Instantly share code, notes, and snippets.

@jhubble
Last active January 31, 2023 08:30
Show Gist options
  • Save jhubble/3f67456ce2ea17a7d990df65a76dd35f to your computer and use it in GitHub Desktop.
Save jhubble/3f67456ce2ea17a7d990df65a76dd35f to your computer and use it in GitHub Desktop.
Output a blogger dump from oldest to newest in html format. Run with xsltproc atom.xsl bloggerdump.xml >out.html
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom"
exclude-result-prefixes="atom"
>
<xsl:output method="html" omit-xml-declaration="no"/>
<xsl:template match="/atom:feed">
<h1>Feed</h1>
<xsl:for-each select="atom:entry">
<xsl:sort select="position()" data-type="number" order="descending"/>
<xsl:if test="atom:category/@term = 'http://schemas.google.com/blogger/2008/kind#post'">
<h3><xsl:value-of select="atom:title"/> [<xsl:value-of select="atom:updated" />]</h3>
<xsl:value-of select="atom:content" disable-output-escaping="yes"/>
<hr />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment