Skip to content

Instantly share code, notes, and snippets.

@pjmagee
Created November 28, 2012 19:00
Show Gist options
  • Select an option

  • Save pjmagee/4163279 to your computer and use it in GitHub Desktop.

Select an option

Save pjmagee/4163279 to your computer and use it in GitHub Desktop.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">>
<xsl:output method="html" version="4.0"/>
<xsl:template match="/lecturers">
<!-- XSLT and Literal Result Elements -->
<html>
<head>
<title>Lecturers</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="1">
<thead>
<tr>
<th>Title</th>
<th>Name</th>
<th>Teaching</th>
<th>Research</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="lecturer">
<tr>
<td>
<!-- Title -->
<xsl:value-of select="name/title" />
</td>
<td>
<!-- Name -->
<xsl:value-of select="name/first" />
<xsl:value-of select="name/last" />
</td>
<td>
<!-- Teaching -->
<xsl:for-each select="teaching">
</xsl:for-each>
</td>
<td>
<!-- Research -->
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment