Skip to content

Instantly share code, notes, and snippets.

@dltj
Created November 29, 2011 20:36
Show Gist options
  • Save dltj/1406383 to your computer and use it in GitHub Desktop.
Save dltj/1406383 to your computer and use it in GitHub Desktop.
XSLT Transformation
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:variable name="newline"><xsl:text>
</xsl:text></xsl:variable>
<xsl:variable name="tab"><xsl:text>&#x09;</xsl:text></xsl:variable>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/html/body[1]/div[1]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr/td">
<xsl:value-of select="normalize-space(.)"/>
<xsl:value-of select="$tab"/>
<xsl:value-of select="/b/strong/a[@href]"/>
<xsl:value-of select="$newline"/>
</xsl:template>
<xsl:template match="text()|@*">
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment