Skip to content

Instantly share code, notes, and snippets.

@vicmortelmans
Created April 7, 2012 21:37
Show Gist options
  • Save vicmortelmans/2332279 to your computer and use it in GitHub Desktop.
Save vicmortelmans/2332279 to your computer and use it in GitHub Desktop.
XSLT to turn YQL html open table output for http://www.doctrinafidei.va/ into XML that can be read by Yahoo Pipes to be turned into an RSS feed
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:o="urn:schemas-microsoft-com:office:office"
version="1.0">
<xsl:output indent="yes"/>
<xsl:template match="/">
<data>
<xsl:apply-templates/>
</data>
</xsl:template>
<xsl:template match="li">
<item>
<title>
<xsl:value-of select="normalize-space(.//a[string-length(.) - string-length(translate(., ' ', '')) > 0])"/>
</title>
<href>
<xsl:text>http://www.doctrinafidei.va/</xsl:text>
<xsl:value-of select=".//a[1]/@href"/>
</href>
<content>
<xsl:value-of select="normalize-space(.)"/>
</content>
</item>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment