| XML schema |
http://scp.eionet.europa.eu/schemas/policyfactsheets/factsheet-v1.xsd
|
|---|---|
| Output type | HTML |
| Description | Waste Policies factsheet |
| XSL file | waste-policies-factsheet.xsl (Last modified: 04 Sep 2009 13:08 ) |
<?xml version="1.0" encoding="UTF-8"?>
<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 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" select="'C:/Projects/eea_svn/Dataflows/WastePolicies/xml/'"/>
<!--xsl:variable name="labels" select="document(concat($xml_folder_uri,'waste-policies-labels.tmxl'))/body/descendant::tu/tuv[@xml:lang='en']"/-->
<xsl:variable name="labels" select="document(concat($xml_folder_uri,'waste-policies-labels.tmx'))/tmx/body/descendant::tu/tuv[@xml:lang='en']"/>
<xsl:template match="countryfactsheet">
<html>
<head>
<title>
<xsl:copy-of select="$labels[parent::tu/@tuid='h1']/seg/text()"/>
</title>
<style type="text/css">
.group{
clear:both;display:block ;margin-top:3px;width:100%;
}
.label{
font-size: 10pt;
width: 30%;
background-color: #f0f0f0;
font-weight: bold;
vertical-align: top;
border-bottom: 0pt;
margin-top:3px;
float:left;
padding: 2px 2px 2px 2px;
}
.value{
float:left;
margin-left:5px;
}
th{
text-align:left;
font-weight: bold;
vertical-align: top;
font-size: 10pt;
border:1px solid black;
padding:5px;
}
table{
margin-top:10px;
width:100%;
border:1px solid black;
border-collapse: collapse;
padding:5px;
}
.instruments th{
width:25%;
border:1px solid black;
}
td{
border:1px solid black;
padding:5px;
vertical-align: top;
}
td.title{
font-weight:bold;
border:1px solid black;
padding:5px;
}
h2{
margin-top:20px;
}
</style>
</head>
<body>
<h1>
<xsl:copy-of select="$labels[parent::tu/@tuid='h1']/seg/text()"/> <xsl:value-of select="general-facts/country"/>
</h1>
<div>
<xsl:apply-templates select="general-facts"/>
<xsl:apply-templates select="legislation"/>
<xsl:apply-templates select="waste-management-plans"/>
<xsl:apply-templates select="waste-prevention"/>
<xsl:apply-templates select="biodegradable-municipal-waste"/>
<xsl:apply-templates select="construction-and-demolition-waste"/>
<xsl:apply-templates select="bibliography"/>
<xsl:apply-templates select="links"/>
</div>
</body>
</html>
</xsl:template>
<!-- 1. general facts -->
<xsl:template match="general-facts">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading1']/seg/text()"/>
</h2>
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="general-facts/*">
<xsl:variable name="lbl" select="name()"/>
<div class="group">
<div class="label"><xsl:copy-of select="$labels[parent::tu/@tuid=concat('heading1-',$lbl)]/seg/text()"/></div>
<div class="value">
<xsl:value-of select="."/>
<xsl:if test="name()='gdp-per-capita'"> <xsl:value-of select="@currency"/> base year: <xsl:value-of select="@year"/></xsl:if>
</div>
</div>
<br/>
</xsl:template>
<!-- 2. -->
<xsl:template match="legislation">
<h2><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading2'"/></xsl:with-param></xsl:call-template></h2>
<xsl:apply-templates select="overview"/>
<xsl:call-template name="acts"/>
<xsl:apply-templates select="regional-acts"/>
</xsl:template>
<xsl:template name="acts">
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'acts'"/></xsl:with-param></xsl:call-template></h3>
<h4><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'national-acts'"/></xsl:with-param></xsl:call-template></h4>
<table border="1">
<col width="20%"></col>
<col width="80%"></col>
<tr>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'reference'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading2-main-features'"/></xsl:with-param></xsl:call-template></th>
</tr>
<xsl:apply-templates select="national-acts"/>
</table>
<h4><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'national-legislation'"/></xsl:with-param></xsl:call-template></h4>
<table border="1">
<col width="20%"></col>
<col width="60%"></col>
<col width="20%"></col>
<tr>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading222-name'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading222-reference'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading222-year'"/></xsl:with-param></xsl:call-template></th>
</tr>
<xsl:apply-templates select="national-legislation"/>
</table>
<h4><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'selected-legislation'"/></xsl:with-param></xsl:call-template></h4>
<table border="1">
<tr>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading223-name'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading223-reference'"/></xsl:with-param></xsl:call-template></th>
</tr>
<xsl:apply-templates select="selected-legislation"/>
</table>
</xsl:template>
<xsl:template match="national-acts">
<tr>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="reference"/></xsl:call-template> </td>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="main-content"/></xsl:call-template><xsl:value-of select="main-content" disable-output-escaping="yes"/> </td>
</tr>
</xsl:template>
<xsl:template match="selected-legislation">
<tr>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="name"/></xsl:call-template> </td>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="reference"/></xsl:call-template> </td>
</tr>
</xsl:template>
<xsl:template match="national-legislation">
<tr>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="name"/></xsl:call-template> </td>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="reference"/></xsl:call-template> </td>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="year"/></xsl:call-template> </td>
</tr>
</xsl:template>
<!-- 3. -->
<xsl:template match="waste-management-plans">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading3']/seg/text()"/>
</h2>
<xsl:apply-templates select="*"/>
</xsl:template>
<!-- 4. -->
<xsl:template match="waste-prevention">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading4']/seg/text()"/>
</h2>
<xsl:apply-templates select="*"/>
</xsl:template>
<!--xsl:template match="strategy">
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'waste-prevention/strategy'"/></xsl:with-param></xsl:call-template></h3>
<xsl:apply-templates select="overview"/>
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem" select="'heading-instrument-info'"/></xsl:call-template></h3>
<xsl:apply-templates select="instrument-info"/>
</xsl:template-->
<!-- 4.6 -->
<xsl:template match="examples">
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading46'"/></xsl:with-param></xsl:call-template></h3>
<div class="group">
<xsl:value-of select="overview" disable-output-escaping="yes"/>
</div>
<table border="1">
<col width="20%"></col>
<col width="80%"></col>
<tr>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading46-example-title'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading46-example-description'"/></xsl:with-param></xsl:call-template></th>
</tr>
<xsl:apply-templates select="example"/>
</table>
</xsl:template>
<xsl:template match="example">
<tr>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="title"/></xsl:call-template> </td>
<td><xsl:call-template name="break"><xsl:with-param name="text" select="description"/></xsl:call-template> </td>
</tr>
</xsl:template>
<!-- 5. -->
<xsl:template match="biodegradable-municipal-waste">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading5']/seg/text()"/>
</h2>
<xsl:apply-templates select="*"/>
</xsl:template>
<!-- 6. -->
<xsl:template match="construction-and-demolition-waste">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading6']/seg/text()"/>
</h2>
<xsl:apply-templates select="*"/>
</xsl:template>
<!-- 7. -->
<xsl:template match="bibliography">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading7']/seg/text()"/>
</h2>
<ul>
<xsl:apply-templates select="*"/>
</ul>
</xsl:template>
<xsl:template match="bibliography/reference">
<li><xsl:value-of select="." disable-output-escaping="yes"/></li>
</xsl:template>
<!-- 7. -->
<xsl:template match="links">
<h2>
<xsl:copy-of select="$labels[parent::tu/@tuid='heading8']/seg/text()"/>
</h2>
<ul>
<xsl:apply-templates select="*"/>
</ul>
</xsl:template>
<xsl:template match="links/link">
<li>
<a>
<xsl:attribute name="href"><xsl:value-of select="url" disable-output-escaping="yes"/></xsl:attribute><xsl:value-of select="url" disable-output-escaping="yes"/></a> - <xsl:value-of select="title" disable-output-escaping="yes"/>
</li>
</xsl:template>
<!-- generic templartes -->
<xsl:template match="strategy|overview|regional-acts|national-plan|regional-plan|objectives|targets|additional-info|results|biodegradable-municipal-waste/strategy|construction-and-demolition-waste/strategy">
<xsl:variable name="lbl" select="name()"/>
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="concat(name(./..),'/',name())"/></xsl:with-param></xsl:call-template></h3>
<div class="group">
<xsl:value-of select="." disable-output-escaping="yes"/>
</div>
</xsl:template>
<xsl:template match="regulatory|market-based|information-based|voluntary">
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="concat(name(./../..),'/',name(./..),'/',name())"/></xsl:with-param></xsl:call-template></h3>
<xsl:apply-templates select="overview"/>
<xsl:if test="name(.)='regulatory' and name(./../..)='waste-prevention' ">
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem" select="'heading-eu-instrument-info'"/></xsl:call-template></h3>
<table>
<xsl:apply-templates select="eu-instrument-info"/>
</table>
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem" select="'heading-cc-instrument-info'"/></xsl:call-template></h3>
</xsl:if>
<xsl:apply-templates select="instrument-info"/>
<xsl:apply-templates select="additional-info"/>
</xsl:template>
<!-- instrument table -->
<xsl:template match="instruments">
<h3><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="concat(name(./..),'/',name())"/></xsl:with-param></xsl:call-template></h3>
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="instrument-info">
<table class="instruments">
<xsl:apply-templates select="*"/>
</table>
</xsl:template>
<xsl:template match="instrument-info/*">
<tr>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="concat('heading-instrument-info-',name())"/></xsl:with-param></xsl:call-template></th>
<td><xsl:if test="name()='title' or name()='scope'"><xsl:attribute name="class">title</xsl:attribute></xsl:if><xsl:call-template name="break"><xsl:with-param name="text" select="."/></xsl:call-template> </td>
</tr>
</xsl:template>
<!-- EU instrument table -->
<xsl:template match="eu-instrument-info">
<xsl:choose>
<xsl:when test="position()=1">
<col width="25%"></col>
<col width="25%"></col>
<col width="15%"></col>
<col width="35%"></col>
<tr>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading-eu-instrument-info-substances'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading-eu-instrument-info-waste-stream'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading-eu-instrument-info-year'"/></xsl:with-param></xsl:call-template></th>
<th><xsl:call-template name="getLabel"><xsl:with-param name="elem"><xsl:value-of select="'heading-eu-instrument-info-legal-document'"/></xsl:with-param></xsl:call-template></th>
</tr>
<tr>
<xsl:apply-templates select="*"/>
</tr>
</xsl:when>
<xsl:otherwise>
<tr>
<xsl:apply-templates select="*"/>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="eu-instrument-info/*">
<td><xsl:call-template name="break"><xsl:with-param name="text" select="."/></xsl:call-template> </td>
</xsl:template>
<xsl:template name="getLabel">
<xsl:param name="elem"/>
<xsl:choose>
<!-- 2. -->
<xsl:when test="$elem='legislation/overview'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading21']/seg/text()"/></xsl:when>
<xsl:when test="$elem='acts'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading22']/seg/text()"/></xsl:when>
<xsl:when test="$elem='national-acts'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading221']/seg/text()"/></xsl:when>
<xsl:when test="$elem='national-legislation'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading222']/seg/text()"/></xsl:when>
<xsl:when test="$elem='selected-legislation'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading223']/seg/text()"/></xsl:when>
<xsl:when test="$elem='legislation/regional-acts'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading23']/seg/text()"/></xsl:when>
<xsl:when test="$elem='reference'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading2-reference']/seg/text()"/></xsl:when>
<xsl:when test="$elem='main-content'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading2-main-content']/seg/text()"/></xsl:when>
<xsl:when test="$elem='national-regulations'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading2-national-regulations']/seg/text()"/></xsl:when>
<!-- 3. -->
<xsl:when test="$elem='waste-management-plans/overview'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading3-overview']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-management-plans/national-plan'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading31']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-management-plans/regional-plan'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading32']/seg/text()"/></xsl:when>
<!-- 4. -->
<xsl:when test="$elem='waste-prevention/objectives'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading41']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/targets'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading42']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/strategy'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading43']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/instruments'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading44']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/instruments/regulatory'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading441']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/instruments/market-based'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading442']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/instruments/information-based'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading443']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/instruments/voluntary'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading444']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/results'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading45']/seg/text()"/></xsl:when>
<xsl:when test="$elem='waste-prevention/examples'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading46']/seg/text()"/></xsl:when>
<!-- 5. -->
<xsl:when test="$elem='biodegradable-municipal-waste/objectives'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading51']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/targets'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading52']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/strategy'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading53']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/instruments'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading54']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/instruments/regulatory'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading541']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/instruments/market-based'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading542']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/instruments/information-based'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading543']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/instruments/voluntary'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading544']/seg/text()"/></xsl:when>
<xsl:when test="$elem='biodegradable-municipal-waste/results'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading55']/seg/text()"/></xsl:when>
<!-- 6. -->
<xsl:when test="$elem='construction-and-demolition-waste/objectives'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading61']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/targets'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading62']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/strategy'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading63']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/instruments'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading64']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/instruments/regulatory'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading641']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/instruments/market-based'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading642']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/instruments/information-based'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading643']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/instruments/voluntary'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading644']/seg/text()"/></xsl:when>
<xsl:when test="$elem='construction-and-demolition-waste/results'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading65']/seg/text()"/></xsl:when>
<!-- genereic -->
<xsl:when test="$elem='instrument-info'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading-instrument-info']/seg/text()"/></xsl:when>
<xsl:when test="$elem='strategy/overview' or $elem='regulatory/overview' or $elem='market-based/overview' or $elem='information-based/overview' or $elem='voluntary/overview' "><xsl:copy-of select="$labels[parent::tu/@tuid='heading-overview']/seg/text()"/></xsl:when>
<xsl:when test="$elem='strategy/additional-info' or $elem='regulatory/additional-info' or $elem='market-based/additional-info' or $elem='information-based/additional-info' or $elem='voluntary/additional-info'"><xsl:copy-of select="$labels[parent::tu/@tuid='heading-additional-info']/seg/text()"/></xsl:when>
<xsl:when test="count($labels[parent::tu/@tuid=$elem]/seg) > 0"><xsl:copy-of select="$labels[parent::tu/@tuid=$elem]/seg/text()"/></xsl:when>
<xsl:otherwise>unknown label</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Replaces line breaks with <br/> tags -->
<xsl:template name="break">
<xsl:param name="text" select="."/>
<xsl:choose>
<xsl:when test="contains($text, ' ')">
<xsl:value-of select="substring-before($text, ' ')"/>
<br/>
<xsl:call-template name="break">
<xsl:with-param name="text" select="substring-after($text, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
European Environment Agency
Kgs. Nytorv 6, DK-1050 Copenhagen K, Denmark