Skip to content

Instantly share code, notes, and snippets.

@siliconmeadow
Last active August 10, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siliconmeadow/0dc7d01d6b61b427983f29d0e7caa300 to your computer and use it in GitHub Desktop.
Save siliconmeadow/0dc7d01d6b61b427983f29d0e7caa300 to your computer and use it in GitHub Desktop.
<?xml version='1.0' encoding='UTF-8'?>
<!--
Transform the term frequency reports to html tables.
-->
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>
<xsl:output media-type="text/html; charset=UTF-8" encoding="UTF-8"/>
<xsl:template match="/">
<html>
<head>
<title>Title goes here</title>
<style>
table, th, td {border: 1px solid black}
</style>
</head>
<body>
<table>
<tr>
<th>Term</th>
<th>Frequency</th>
</tr>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="lst[@name='tm_title']/int[@name]" name="termfreq">
<tr>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="."/></td>
</tr>
</xsl:template>
<xsl:template match="lst[@name='responseHeader']/int[@name='QTime']"></xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment