Skip to content

Instantly share code, notes, and snippets.

@spdustin
Last active March 1, 2016 17:35
Show Gist options
  • Save spdustin/3e297cb620b627586124 to your computer and use it in GitHub Desktop.
Save spdustin/3e297cb620b627586124 to your computer and use it in GitHub Desktop.
cars.xsl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:template match="/">
<table>
<thead>
<tr>
<th>Year</th>
<th>Make</th>
<th>Model</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates/>
</tbody>
</table>
</xsl:template>
<xsl:template match="/cars/car">
<tr>
<td>
<xsl:value-of select="@year" />
</td>
<td>
<xsl:value-of select="@make" />
</td>
<td>
<xsl:value-of select="@model" />
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment