View stylesheet

XML schemas http://waste.eionet.europa.eu/schemas/oilwaste/schema.xsd
Output type HTML
Description Directive 75/439 factsheet
XSL file dir75439factsheet.xsl (Last modified: 07 Apr 2008 10:31 )
<?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,'dir75439_labels.xml'))/labels/itemset[@id='75439' 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(.),'Quest75439-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(.),'Quest75439-II-')]"/>
				</table>
			</body>
		</html>
	</xsl:template>

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


	<xsl:template match="Quest75439-I-1a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-1b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-2a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-2b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-2c-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-3a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-3b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-I-3c-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<!--   II -->
	<xsl:template match="Quest75439-II-1a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-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="Quest75439-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="Quest75439-II-1c-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-IDYear']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-TOS']/text()"/>
			</th>
			<th colspan="2">
				<xsl:copy-of select="$labels/item[@id='II-1c-TWOG']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDYear"/>
			</td>
			<td>
				<xsl:value-of select="TOS"/>
			</td>
			<td colspan="2">
				<xsl:value-of select="TWOG"/>
			</td>
		</tr>
		<tr>
			<th colspan="4">
				<xsl:copy-of select="$labels/item[@id='II-1c-h2']/text()"/>
			</th>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-TWOG_COL']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-TWOG_REG']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-TWOG_COM']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-1c-TWOG_TIP']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="TWOG_COL"/>
			</td>
			<td>
				<xsl:value-of select="TWOG_REG"/>
			</td>
			<td>
				<xsl:value-of select="TWOG_COM"/>
			</td>
			<td>
				<xsl:value-of select="TWOG_TIP"/>
			</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="Quest75439-II-1c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-2a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-2b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-2c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-2d-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-2e">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-2f-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-3a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-3b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

<!-- ##################################        II    4  table           ############################################-->

	<xsl:template match="Quest75439-II-4-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="3">
							<xsl:copy-of select="$labels/item[@id='II-4-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-4-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-IDNUTS']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-NumberNUTS']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-PSE']/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="PSE"/>
				</xsl:call-template>
			</td>
		</tr>
		<tr>
			<th colspan="3">
				<xsl:copy-of select="$labels/item[@id='II-4-h2']/text()"/>
			</th>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-IDWasteOil']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-TNUR-P']/text()"/>
			</th>
			<th rowspan="2" />
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDWasteOil"/>
			</td>
			<td>
				<xsl:value-of select="TNUR-P"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-4-Comments']/text()"/>
			</th>
			<td colspan="2">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-4">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-5a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-5b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-5c-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

<!-- ##################################        II    6a  table           ############################################-->
	

	<xsl:template match="Quest75439-II-6a-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="4">
							<xsl:copy-of select="$labels/item[@id='II-6a-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-6a-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-6a-IDNUTS']/text()"/>
			</th>
			<th colspan="3">
				<xsl:copy-of select="$labels/item[@id='II-6a-NumberNUTS']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDNUTS"/>
			</td>
			<td colspan="3">
				<xsl:value-of select="NumberNUTS"/>
			</td>
		</tr>
		<tr>
			<th colspan="4">
				<xsl:copy-of select="$labels/item[@id='II-6a-h2']/text()"/>
			</th>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-6a-IDWasteOil']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-6a-NP_REG']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-6a-NP_COM']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-6a-NP_TIP']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDWasteOil"/>
			</td>
			<td>
				<xsl:value-of select="NP_REG"/>
			</td>
			<td>
				<xsl:value-of select="NP_COM"/>
			</td>
			<td>
				<xsl:value-of select="NP_TIP"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-6a-Comments']/text()"/>
			</th>
			<td colspan="3">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-6a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-6b">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

<!-- ##################################        II    7a+7b  table           ############################################-->
	<xsl:template match="Quest75439-II-7a7b-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="3">
							<xsl:copy-of select="$labels/item[@id='II-7a7b-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-7a7b-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7a7b-IDSubstance']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7a7b-Value-gt-3MW']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7a7b-Value-lt-3MW']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDSubstance"/>
			</td>
			<td>
				<xsl:value-of select="Value-gt-3MW"/>
			</td>
			<td>
				<xsl:value-of select="Value-lt-3MW"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7a7b-Comments']/text()"/>
			</th>
			<td colspan="2">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-7a7b">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
					
<!-- ##################################        II    7c  table           ############################################-->
	<xsl:template match="Quest75439-II-7c-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="3">
							<xsl:copy-of select="$labels/item[@id='II-7c-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-7c-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7c-IDThermalInput']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7c-IDNUTS']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7c-NumberNUTS']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDThermalInput"/>
			</td>
			<td>
				<xsl:value-of select="IDNUTS"/>
			</td>
			<td>
				<xsl:value-of select="NumberNUTS"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-7c-Comments']/text()"/>
			</th>
			<td colspan="2">
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-7c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
<!-- ##################################        II    8  table           ############################################-->
	<xsl:template match="Quest75439-II-8-table">
		<tr>
			<td colspan="2">
				<table class="tbl">
					<tr>
						<th colspan="2">
							<xsl:copy-of select="$labels/item[@id='II-8-table']/text()"/>
						</th>
					</tr>
					<xsl:apply-templates/>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-8-row">
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-8-IDProces']/text()"/>
			</th>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-8-MinimumQuantity']/text()"/>
			</th>
		</tr>
		<tr>
			<td>
				<xsl:value-of select="IDProces"/>
			</td>
			<td>
				<xsl:value-of select="MinimumQuantity"/>
			</td>
		</tr>
		<tr>
			<th>
				<xsl:copy-of select="$labels/item[@id='II-8-Comments']/text()"/>
			</th>
			<td>
				<xsl:value-of select="Comments"/>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="Quest75439-II-8">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-9a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-9b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-10a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75439-II-10b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
					
					
	<!-- YesNoUnknown implementation -->
	<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>

	<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>