View stylesheet

XML schemas http://waste.eionet.europa.eu/schemas/waste/schema.xsd
Output type HTML
Description Directive 75/442 factsheet
XSL file dir75442factsheet.xsl (Last modified: 07 Apr 2008 10:34 )
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" omit-xml-declaration="yes"/>

	<!-- import labels xml file -->
	<xsl:param name="xml_folder_uri"/>
	<xsl:variable name="labels" select="document(concat($xml_folder_uri,'dir75442_labels.xml'))/labels/itemset[@id='75442' and @xml:lang='en']"/>
	
	<xsl:template match="Questionnaire">
		<html>
			<head>
				<title>
					<xsl:copy-of select="$labels/item[@id='h1']/text()"/>
				</title>
					<style type="text/css">
.tbl{
	width:100%;
	padding: 0.3em 0em;
	margin-top:0.4em;
}
.tbl th{
	text-align:left;
	border:1px solid #d3d3d3;;
}
.tbl td{
	align:left;
	border:1px solid #d3d3d3;
}
					</style>
			</head>
			<body>
				<h1>
					<xsl:copy-of select="$labels/item[@id='h1']/text()"/>
				</h1>
				<table border="1">
					<tr>
						<th colspan="2">
							<xsl:value-of select="$labels/item[@id='I-h2']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates select="*[starts-with(local-name(.),'Quest75442-I-')]"/>
				</table>
				<table border="1">
					<tr>
						<th colspan="2">
							<xsl:value-of select="$labels/item[@id='II-h2']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates select="*[starts-with(local-name(.),'Quest75442-II-')]"/>
				</table>
			</body>
		</html>
	</xsl:template>

		<!-- ##################################          PAGE 1           ############################################-->


	<xsl:template match="Quest75442-I-1a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-I-1b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>


<!-- ##################################       I    2  table           ############################################-->
	
	<xsl:template match="Quest75442-I-2-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="5">
							<xsl:copy-of select="$labels/item[@id='I-2-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75442-I-2-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='I-2-IDNUTS']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='I-2-NumberNUTS']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='I-2-WMP']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='I-2-PDO']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='I-2-PRO']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDNUTS"/>
			</td>
			<td>
				<xsl:value-of select="NumberNUTS"/>
			</td>
			<td>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="WMP"/>
				</xsl:call-template>
			</td>
			<td>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="PDO"/>
				</xsl:call-template>
			</td>
			<td>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="PRO"/>
				</xsl:call-template>
			</td>
		</tr>
		<tr>
			<th colspan="2">
				<xsl:copy-of select="$labels/item[@id='I-2-RER']/text()"/>
			</th>
			<th colspan="3">
				<xsl:copy-of select="$labels/item[@id='I-2-REUP']/text()"/>
			</th>
		</tr>
		<tr>
			<td colspan="2">
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="RER"/>
				</xsl:call-template>
			</td>
			<td colspan="3">
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="REUP"/>
				</xsl:call-template>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='I-2-Comments']/text()"/>
			</th>
			<td colspan="4">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75442-I-2">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

		<!-- ##################################          PAGE 2           ############################################-->


	<xsl:template match="Quest75442-II-1a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

<!-- ##################################      II   1c  table           ############################################-->
	
	<xsl:template match="Quest75442-II-1c-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="4">
							<xsl:copy-of select="$labels/item[@id='II-1c-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75442-II-1c-row">
		<tr>
			<th></th>
			<th colspan="3"><xsl:copy-of select="$labels/item[@id='II-1c-h2']/text()"/></th>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Authority']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Adoption-publication']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-StartApplication']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-EndApplication']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="Authority"/>
			</td>
			<td>
				<xsl:value-of select="Adoption-publication"/>
			</td>
			<td>
				<xsl:value-of select="StartApplication"/>
			</td>
			<td>
				<xsl:value-of select="EndApplication"/>
			</td>
		</tr>
		<tr>
			<th colspan="4"><xsl:copy-of select="$labels/item[@id='II-1c-h3']/text()"/></th>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Domestic-waste']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Hazardous-waste']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Others']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Area-covered']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="Domestic-waste"/>
				</xsl:call-template>
			</td>
			<td>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="Hazardous-waste"/>
				</xsl:call-template>
			</td>
			<td>
				<xsl:value-of select="Others"/>
			</td>
			<td>
				<xsl:value-of select="Area-covered"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-Comments']/text()"/>
			</th>
			<td colspan="3">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75442-II-1c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1d-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1d-ii-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1e-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1e-ii-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-2a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-2b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3d">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
<!-- ##################################      II   4  table           ############################################-->
	
	<xsl:template match="Quest75442-II-4-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="6">
							<xsl:copy-of select="$labels/item[@id='II-4-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75442-II-4-row">
		<tr>
			<th colspan="3">
				<xsl:copy-of select="$labels/item[@id='II-4-IDYear']/text()"/>
			</th>
			<th colspan="3">
				<xsl:copy-of select="$labels/item[@id='II-4-IDWasteFractions']/text()"/>
			</th>
		</tr>
		<tr>
			<td colspan="3">
				<xsl:value-of select="IDYear"/>
			</td>
			<td colspan="3">
				<xsl:value-of select="IDWasteFractions"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Recyled']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Incinerated-with-energy-recovery']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Incinerated']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Landfill']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Other']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Total']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="Recyled"/>
			</td>
			<td>
				<xsl:value-of select="Incinerated-with-energy-recovery"/>
			</td>
			<td>
				<xsl:value-of select="Incinerated"/>
			</td>
			<td>
				<xsl:value-of select="Landfill"/>
			</td>
			<td>
				<xsl:value-of select="Other"/>
			</td>
			<td>
				<xsl:value-of select="Total"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Comments']/text()"/>
			</th>
			<td colspan="5">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75442-II-4">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-5a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-5b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6a-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6a-ii-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6b-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6b-ii-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>






	<!-- buid html table TR for one question -->
	<xsl:template name="buildTR">
		<xsl:param name="yesno"/>
		<xsl:param name="label_id" select="substring(local-name(.),12)"/>

		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id=$label_id]/text()"/>
			</th>
			<td>
				<xsl:choose>
					<xsl:when test="$yesno=true()">
						<xsl:call-template name="YesNoUnknown">
							<xsl:with-param name="Param" select="."/>
						</xsl:call-template>
					</xsl:when>
					<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
				</xsl:choose>
			</td>
		</tr>
	</xsl:template>

	<!-- YesNoUnknown implementation -->
	<xsl:template name="YesNoUnknown">
		<xsl:param name="Param"/>
		<xsl:choose>
			<xsl:when test="$Param = '1' or $Param = 'true'">Yes</xsl:when>
			<xsl:when test="$Param = '0' or $Param = 'false'">No</xsl:when>
			<xsl:when test="$Param = ''">Unanswered</xsl:when>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="*"/>
</xsl:stylesheet>