Skip to content

Instantly share code, notes, and snippets.

@marfalkov
Last active August 29, 2015 13:59
Show Gist options
  • Save marfalkov/10687726 to your computer and use it in GitHub Desktop.
Save marfalkov/10687726 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<rows>
<xsl:apply-templates select="descendant::tr" />
</rows>
</xsl:template>
<xsl:template match="//tr">
<xsl:choose>
<xsl:when test="td[2]/div !=''">
<row>
<title>
<xsl:value-of select="td[2]/div/a" />
</title>
<link>
<xsl:value-of select="td[2]/div/a/@href" />
</link>
<seeders>
<xsl:value-of select="td[3]" />
</seeders>
</row>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment