Skip to content.

The E-Learning Framework

Sections
Personal tools
You are here: Home » ELF Project Directory » Course Information Group » XSL to produce MMU prog spec
Views

XSL to produce MMU prog spec

Sample XSLT to produce a Manchester Metropolitan University Programme Specification document

Click here to get the file

Size 13.4 kB - File type text/xml

File contents

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" 

	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

	xmlns:xhtml="http://www.w3.org/1999/xhtml"

	xmlns:efc="http://elframework.org/curriculum/elements"

	xmlns:dc="http://purl.org/dc/elements/1.1/"

	exclude-result-prefixes="xhtml"

>



  <xsl:output method="html" /> 

	

	<xsl:template match="/">

		<html xmlns="http://www.w3.org/1999/xhtml">

			<head>

				<title>MMU Programme Specification</title>

				<style>

					div.container {

						border: 1px dotted #333;

						clear: both;		

						padding: 5px;

						margin: 0px auto;

					}



					div.row {

					  clear: both;

					  padding-top: 10px;

					}

					

					div.row span.label {

						float: left;

						width: 200px;

						text-align: left;

						padding: 2px;

						font-weight: bold;					  

					}

					

					div.row span.content {

					  float: left;

					  width: auto;

					  text-align: left;

					  padding: 2px;

					}

					

					div.row span.content p { 

						margin-top: 0px; 

						margin-bottom: 4px; 

						margin-left: 0; 

					}

										

					div.spacer {

					  clear: both;

					 }

					 

					 thead tr td {

						 font-weight: bold;

					 }

					  										

				</style>				

			</head>

			<body>

				<xsl:apply-templates select="//efc:spec[@type='Programme']"/>

			</body>

		</html>

	</xsl:template>

			

	<xsl:template match="efc:spec">

		<div class="spacer">&#160;</div>

		<div class="container">

			<xsl:choose>

				<xsl:when test="@type='Programme'">

					<div class="row">

						<span class="label">Programme Code:</span>

						<span class="content"><xsl:value-of select="efc:identifier" /></span>

					</div>

					<div class="row">

						<span class="label">Programme Title:</span>

						<span class="content"><xsl:value-of select="dc:title" /></span>

					</div>

					<div class="row">

						<span class="label">Home Faculty:</span>

						<span class="content"><xsl:call-template name="orgsResolver"><xsl:with-param name="orgsRef" select="efc:owningBodies" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">Next Review:</span>

						<span class="content"><xsl:value-of select="@validTo" /></span>

					</div>

					<div class="row">

						<span class="label">Programme Aims:</span>

						<span class="content"><xsl:call-template name="aimsResolver"><xsl:with-param name="aimsRef" select="efc:aims" /></xsl:call-template></span>

					</div>

				</xsl:when>

				<xsl:when test="@type='Course'">

					<div class="row">

						<span class="label">Course Code:</span>

						<span class="content"><xsl:value-of select="efc:identifier" /></span>

					</div>

					<div class="row">

						<span class="label">Course Title:</span>

						<span class="content"><xsl:value-of select="dc:title" /></span>

					</div>

					<div class="row">

						<span class="label">JACS Code:</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="efc:code[@type='JACS']" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">UCAS Code:</span>

						<span class="content"><xsl:value-of select="efc:code[@type='UCAS']" /></span>

					</div>

					<div class="row">

						<span class="label">Prospectus Text:</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="efc:description" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">Course-specific Entry Requirements:</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="efc:admission" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">Course-specific Regs Variations:</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="efc:regulations" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">Keyword:</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="dc:subject" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">Career Prospects:</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="efc:career" /></xsl:call-template></span>

					</div>

					<div class="row">

						<span class="label">Special Feature(s):</span>

						<span class="content"><xsl:call-template name="multi"><xsl:with-param name="nodeSet" select="efc:specialFeature" /></xsl:call-template></span>

					</div>

					<xsl:apply-templates select="efc:recognitions/efc:recognition/efc:award" />

					<xsl:apply-templates select="efc:offeringPattern" />

					<xsl:call-template name="accreditationsResolver"><xsl:with-param name="accreditationsRef" select="efc:accreditations" /></xsl:call-template>

					<xsl:call-template name="benchmarksResolver"><xsl:with-param name="benchmarksRef" select="efc:benchmarks" /></xsl:call-template>					

				</xsl:when>

				<xsl:when test="@type='Stage'">

					<div class="row">

						<span class="label">Stage Code:</span>

						<span class="content"><xsl:value-of select="efc:identifier" /></span>					

					</div>

					<div class="row">

						<span class="label">Stage Title:</span>

						<span class="content"><xsl:value-of select="dc:title" /></span>					

					</div>

					<xsl:apply-templates select="efc:learningOutcomes" />

					<xsl:apply-templates select="efc:specAssembly" />

				</xsl:when>

			</xsl:choose>

			<div class="spacer">&#160;</div>

			<xsl:apply-templates select="efc:specAssembly/efc:spec" />

		</div>

	</xsl:template>



	<xsl:template match="efc:award">

		<div class="spacer">&#160;</div>	

		<div class="container">		

			<div class="row">

				<span class="label">Award Type</span>

				<span class="content"><xsl:value-of select="@type" /></span>

			</div>

			<div class="row">

				<span class="label">Award Title</span>

				<span class="content"><xsl:value-of select="efc:awardTitle" /></span>

			</div>

			<div class="row">

				<span class="label">Awarding Body</span>

				<span class="content"><xsl:call-template name="orgsResolver"><xsl:with-param name="orgsRef" select="efc:awardingBodies" /></xsl:call-template></span>

			</div>

			<div class="row">

				<span class="label">Award Level (NQF)</span>

				<span class="content"><xsl:value-of select="efc:awardLevel[@type='NQF']" /></span>

			</div>

			<div class="row">

				<span class="label">Award Level (FHEQ)</span>

				<span class="content"><xsl:value-of select="efc:awardLevel[@type='FHEQ']" /></span>

			</div>

			<div class="row">

				<span class="label">Award Level (Other)</span>

				<span class="content"><xsl:value-of select="efc:awardLevel[@type!='NQF' and @type!='FHEQ']" /></span>

			</div>

			<div class="spacer">&#160;</div>

		</div>

	</xsl:template>

	

	<xsl:template match="efc:offeringPattern">

		<div class="spacer">&#160;</div>	

		<div class="container">

			<div class="row">

				<span class="label">Mode of Delivery</span>

				<span class="content"></span>

			</div>

			<div class="row">

				<span class="label">Normal Duration</span>

				<span class="content"></span>

			</div>

			<div class="row">

				<span class="label">Teaching Time(s)</span>

				<span class="content"></span>

			</div>

			<div class="row">

				<span class="label">Teaching Place(s)</span>

				<span class="content"></span>

			</div>

			<div class="row">

				<span class="label">Teaching Bodies(s)</span>

				<span class="content"></span>

			</div>

			<div class="row">

				<span class="label">Type of Collaboration</span>

				<span class="content"></span>

			</div>

			<div class="spacer">&#160;</div>		

		</div>

	</xsl:template>



	<xsl:template match="efc:accreditation">

		<div class="spacer">&#160;</div>	

		<div class="container">

			<div class="row">

				<span class="label">Accrediting Body</span>

				<span class="content"><xsl:call-template name="orgsResolver"><xsl:with-param name="orgsRef" select="efc:accreditingBodies" /></xsl:call-template></span>

			</div>

			<div class="row">

				<span class="label">Accreditation Outcome</span>

				<span class="content"><xsl:value-of select="dc:description" /></span>

			</div>

			<div class="row">

				<span class="label">Accredited From</span>

				<span class="content"><xsl:value-of select="efc:accreditedFrom" /></span>

			</div>

			<div class="row">

				<span class="label">Accredited Until</span>

				<span class="content"><xsl:value-of select="efc:accreditedTo" /></span>

			</div>

			<div class="row">

				<span class="label">Accredited Award(s)</span>

				<span class="content"></span>

			</div>

			<div class="spacer">&#160;</div>		

		</div>

	</xsl:template>



	<xsl:template match="efc:benchmark">

		<div class="spacer">&#160;</div>	

		<div class="container">

			<div class="row">

				<span class="label">Benchmark Statement</span>

				<span class="content"><xsl:value-of select="efc:description" /> (<xsl:value-of select="efc:identifier" />)</span>

			</div>

			<div class="spacer">&#160;</div>		

		</div>

	</xsl:template>



	<xsl:template name="multi">

		<xsl:param name="nodeSet" />

			<xsl:for-each select="$nodeSet">

				<p><xsl:value-of select="." /></p>

			</xsl:for-each>

	</xsl:template>



	<xsl:template match="efc:aim | efc:organization">

		<p><xsl:value-of select="efc:description" /></p>

	</xsl:template>



	<xsl:template match="efc:learningOutcomes">

		<div class="row">

				<table width="100%">

					<thead>

						<tr>

							<td width="10%">&#160;</td>

							<td width="80%">Learning Outcomes</td>

							<td width="10%">RefBench</td>

						</tr>

					</thead>

					<tbody>

						<xsl:apply-templates select="efc:learningOutcome" />	

					</tbody>

				</table>

		</div>

	</xsl:template>



	<xsl:template match="efc:learningOutcome">

		<tr>

			<td><xsl:value-of select="efc:identifier" /></td>

			<td><xsl:value-of select="efc:description" /></td>

			<td><xsl:value-of select="efc:relatedBenchmarks" /></td>

		</tr>

	</xsl:template>



	<xsl:template match="efc:specAssembly">

		<div class="row">

				<table width="100%">

					<thead>

						<tr>

							<td width="10%">Unit</td>

							<td width="50%">Description</td>

							<td width="10%">Level</td>

							<td width="10%">Credit</td>

							<td width="10%">C/O</td>

							<td width="10%">RefLO</td>

						</tr>

					</thead>

					<tbody>

						<xsl:call-template name="specsResolver"><xsl:with-param name="specsRef" select="." /></xsl:call-template>

					</tbody>

				</table>

		</div>		

	</xsl:template>



	<xsl:template name="accreditationsResolver">

		<xsl:param name="accreditationsRef" />

			<xsl:apply-templates select="//efc:accreditation[efc:identifier=$accreditationsRef/efc:accreditationRef] | $accreditationsRef/efc:accreditation" />

	</xsl:template>



	<xsl:template name="aimsResolver">

		<xsl:param name="aimsRef" />

			<xsl:apply-templates select="//efc:aim[efc:identifier=$aimsRef/efc:aimRef] | $aimsRef/efc:aim" />

	</xsl:template>



	<xsl:template name="benchmarksResolver">

		<xsl:param name="benchmarksRef" />

			<xsl:apply-templates select="//efc:benchmark[efc:identifier=$benchmarksRef/efc:benchmarkRef] | $benchmarksRef/efc:benchmark" />

	</xsl:template>

	

	<xsl:template name="orgsResolver">

		<xsl:param name="orgsRef" />

			<xsl:apply-templates select="//efc:organization[efc:identifier=$orgsRef/efc:organizationRef] | $orgsRef/efc:organization" />

	</xsl:template>



	<xsl:template name="specsResolver">

		<xsl:param name="specsRef" />

		<xsl:for-each select="$specsRef/efc:specRef">

			<xsl:call-template name="stageUnit">

				<xsl:with-param name="identifier" select="." />

				<xsl:with-param name="level" select="@level" />

				<xsl:with-param name="credit" select="@credit" />

				<xsl:with-param name="core" select="parent::*/@collection" />

			</xsl:call-template>

		</xsl:for-each>

		<xsl:for-each select="$specsRef/efc:spec">

			<xsl:call-template name="stageUnit">

				<xsl:with-param name="identifier" select="efc:identifier" />

				<xsl:with-param name="level" select="@level" />

				<xsl:with-param name="credit" select="@credit" />

				<xsl:with-param name="core" select="parent::*/@collection" />

			</xsl:call-template>

		</xsl:for-each>		

	</xsl:template>



	<xsl:template name="stageUnit">

		<xsl:param name="identifier" />

		<xsl:param name="level" />

		<xsl:param name="credit" />

		<xsl:param name="core" />		

		<xsl:param name="spec" select="//efc:spec[efc:identifier=$identifier]" />

		<tr>

			<td><xsl:value-of select="$identifier" /></td>

			<td><xsl:value-of select="$spec/dc:title" /></td>

			<td>

				<xsl:choose>

					<xsl:when test="$level"><xsl:value-of select="$level" /></xsl:when>

					<xsl:otherwise><xsl:value-of select="$spec/@level" /></xsl:otherwise>

				</xsl:choose>

			</td>

			<td>

				<xsl:choose>

					<xsl:when test="$credit"><xsl:value-of select="$credit" /></xsl:when>

					<xsl:otherwise><xsl:value-of select="$spec/@credit" /></xsl:otherwise>

				</xsl:choose>

			</td>

			<td>

				<xsl:choose>

					<xsl:when test="$core='mandatories'">C</xsl:when>

					<xsl:otherwise>O</xsl:otherwise>

				</xsl:choose>

			</td>

			<td>

				<xsl:value-of select="//efc:learningOutcome[efc:relatedSpecs/efc:specRef=$identifier]/efc:identifier" />

			</td>

		</tr>

	</xsl:template>

</xsl:stylesheet>

Created by stubbsy
Last modified 2006-03-16 10:04 PM
Funding Partner
JISC Distributed eLearning Strand
« May 2012 »
Su Mo Tu We Th Fr Sa
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Files and Documents
Implements services
Related ELF services
No files or documents.