View stylesheet

XML schema http://dd.eionet.europa.eu/schemas/IEDAnnexIIModule4/module4.xsd
Output type HTML
Description HTML preview
XSL file IEDAnnexIIModule4-html.xsl (Last modified: 08 Nov 2018 19:49 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"
    xmlns:skos="http://www.w3.org/2004/02/skos/core#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <xsl:output method="html" 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"/>

    <xsl:variable name="TypeOfPlantCodeURL" select="document('http://dd.eionet.europa.eu/vocabulary/IEDAnnexIIModule4/TypeOfPlantCode/rdf')"/>
    <xsl:variable name="ResultsOfVerificationsCodeURL" select="document('http://dd.eionet.europa.eu/vocabulary/IEDAnnexIIModule4/ResultsOfVerificationsCode/rdf')"/>
    <xsl:variable name="AirPollutingSubstancesCodeURL" select="document('http://dd.eionet.europa.eu/vocabulary/IEDAnnexIIModule4/AirPollutingSubstancesCode/rdf')"/>
    <xsl:variable name="WaterPollutingSubstancesCodeURL" select="document('http://dd.eionet.europa.eu/vocabulary/IEDAnnexIIModule4/WaterPollutingSubstancesCode/rdf')"/>
    <xsl:variable name="DerogationTypeURL" select="document('http://dd.eionet.europa.eu/vocabulary/IEDAnnexIIModule4/DerogationType/rdf')"/>
    
    
   <!--  <xsl:variable name="labelsLanguage" select="IEDModule4/@xml:lang"/>
    <xsl:variable name="labels" select="document('module4-labels-en.xml')/labels"/> -->
    
    <xsl:variable name="schema"
                  select="document('http://dd.eionet.europa.eu/schemas/IEDAnnexIIModule4/module4.xsd')/xs:schema"/>
    <xsl:variable name="labelsLanguage" select="IEDModule4/@xml:lang"/>
    <xsl:variable name="xmlPath" select="'https://converterstest.eionet.europa.eu/xmlfile'"/>
    <xsl:variable name="labelsUrl">
        <xsl:choose>
            <xsl:when test="doc-available(concat($xmlPath, 'IEDAnnexIIModule4-labels-', $labelsLanguage ,'.xml'))">
                <xsl:value-of select="concat($xmlPath, 'IEDAnnexIIModule4-labels-', $labelsLanguage ,'.xml')"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="concat($xmlPath, '/IEDAnnexIIModule4-labels-en.xml')"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="labels" select="document($labelsUrl)/labels"/>

    <xsl:template name="getLabel">
        <xsl:param name="labelName"/>
        <xsl:variable name="labelValue" select="$labels/*[local-name() = $labelName]"/>
        <xsl:choose>
            <xsl:when test="string-length($labelValue) &gt; 0">
                <xsl:value-of disable-output-escaping="yes" select="$labelValue"/>
            </xsl:when>
            <xsl:otherwise>- <xsl:value-of disable-output-escaping="yes" select="$labelName"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


    <xsl:template name="getYesNoValue">
        <xsl:param name="elem"/>
        <xsl:variable name="elemValue">
            <xsl:choose>
                <xsl:when test="$elem/text()='true'">Yes</xsl:when>
                <xsl:when test="$elem/text()='false'">No</xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$elem"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:value-of select="$elemValue"/>
    </xsl:template>

    <xsl:template name="getCDLValue">
        <xsl:param name="elem"/>
        <xsl:param name="codelistURL" />
        <xsl:variable name="codeValue" select="$codelistURL/rdf:RDF/skos:Concept/skos:notation[text()= $elem/text()]/../skos:prefLabel/text()"/>
        <xsl:choose>
            <xsl:when test="codeValue = ''">
                <xsl:value-of disable-output-escaping="yes" select="$elem"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of disable-output-escaping="yes" select="$codeValue"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
 
    <xsl:template match="/">
        <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <title>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'Questionnaire-title'"/>
                    </xsl:call-template>
                </title>
                <meta content="text/html; charset=utf-8"/>
                <style type="text/css">
                    /*@media print{@page {size: landscape}}*/
                    @page {
                        size: A4;
                        /*margin: 0;*/
                        margin-right: 0.5em;
                        margin-left: 0.5em;
                    }
                    @media print {

                        html, body {
                            width: 210mm;
                            height: 297mm;
                        }
                        @page {size: landscape}
                        table { page : rotated}
                        table{  font-size: 6pt;}
                        th { page-break-inside : avoid }
                        td { page-break-inside : avoid;  white-space: pre-line;}
                        tr { page-break-inside : avoid }
                        /*.table-2{ page-break-inside : avoid}*/
                        #table-3 { display: none; !important}
                        .table-3-print{display: inherit !important}
                        /*.table-3-print{ page-break-inside : avoid !important;}*/
                        .table-3-print, .table-3-print tr , .table-3-print tr td{width: 100% !important;padding-bottom: 1em;}
                        .table-3-print-all, .table-3-print-all table {width: 100% !important; display: inherit !important; }
                        #table-3-main-h2{display: none !important;}
                        h2 { page-break-after : avoid }
                        @page{orphans:4; widows:2;}

                        #table-6 { display: none; !important}
                        .table-6-print{display: inherit !important; padding-bottom: 1em;}

                        th{text-align: center !important;
                            padding: 0;}
                        td{ padding: 0;}

                    }
                    /*@media print{@page {
                        -webkit-transform: rotate(-90deg); -moz-transform:rotate(-90deg);
                        filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
                    }*/
                    #table-3-main-h2{display: inherit;}
                    .table-3-print-all{display: none;}
                    .table-3-print{display: none;}
                    .table-6-print{display: none;}
                    body {
                        font-size: 80%;
                        font-family: verdana, helvetica, arial, sans-serif;
                        color: #333;
                        margin-left:30px;
                    }
                    h1 {
                        font-size: 160%;
                        color: #315076;
                        text-align: center;
                        padding-bottom: 0.5em;
                        font-style: italic;
                    }
                    h2 {
                        font-size: 130%;
                        border-bottom: 1px solid #999999;
                        font-style: italic;
                        margin-left:-25px;
                    }
                    h3{
                        font-size: 110%;
                        color: #315076;
                        margin-left:-25px;
                    }
                    h4{
                        font-size: 110%;
                        color: #315076;
                        margin-top: 10px;
                        margin-bottom: 5px;
                    }
                    caption {
                        display: none;
                        font-family: vardana, verdana, helvetica, arial, sans-serif;
                        text-align: left;
                        font-size: 150%;
                    }

                    table {
                        border-collapse: collapse;
                    }
                    th, td{
                        padding: 0.5em 0.5em 0.5em 0.5em;
                        text-align:left;
                        border: 1px solid #bbb;
                    }
                    th {
                        background-color: #f9f8f6;
                        text-align: left;
                        vertical-align: bottom;

                    }
                    td{
                        text-align: left;
                        vertical-align: text-top;
                    }
                    table.datatable {
                        width: 100%;
                    }

                    table.question{
                        margin-top: 13px;
                    }
                    table.question th, table.question td{
                        vertical-align: top;
                        border: none;
                    }
                    table.question th{
                        font-size: 105%;
                        color: #315076;
                        background-color: transparent;
                        padding-left: 0;
                    }
                    table.second{
                        margin-top: 5px;
                    }
                    .sub {
                        font-size: 0.8em;
                    }

                    sup {
                        font-size: 0.8em;
                        font-style: italic;
                        color: #777;
                    }
                    .note{
                        font-size: 0.8em;
                        font-weight: normal;
                        color: #315076;
                    }
                    .value {
                        background-color: #ffffe0;
                    }
                    .disabled td{
                        background-color:lightgrey;
                    }
                    .italicTableHeading{
                        font-style: italic;
                        color: black;
                        margin-left: 1em;
                    }
                    .total {
                        font-weight: bold;
                    }
                    .note{ color: darkblue;}
                    .sub-header{ font-weight: bold;
                        color: #000000;
                        font-size: larger;}
                    .padding-bottom{
                        padding-bottom: 2em;
                    }
                </style>
            </head>
            <body>
                <h1>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'Questionnaire-title'"/>
                    </xsl:call-template>
                </h1>
                <xsl:apply-templates/>
                <div class="padding-bottom"/>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="IEDModule4/WasteIncinerationCoIncinaration">
        <h2>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question11-heading'"/>
            </xsl:call-template>
        </h2>
        <h3>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question11-1-2'"/>
            </xsl:call-template>
        </h3>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question11-1-2-note'"/>
            </xsl:call-template>
        </h4>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'all-plants'"/>
            </xsl:call-template>
        </h4>
        <table id="question11">
            <tr>
                <th colspan="20"></th>
                <th colspan="8">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <th colspan="9"></th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'waste-type'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'location'"/>
                    </xsl:call-template>
                </th>
                <th colspan="4">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'address'"/>
                    </xsl:call-template>
                </th>
                <th colspan="3"></th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'art501'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'art502'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'art503'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'art504'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2a'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question12-2b'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'plantName'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'cap-bel-2t'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2h'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2i'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2j'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2k'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2c'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'hazardousWaste'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'nonHazardousWaste'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2f'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2e'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'street'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'number'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'town-village'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'postal'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2l'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2m'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2n'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1a'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'results'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1b'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'results'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1c'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'results'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1d'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'results'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <xsl:for-each select="./Plant">
                <tr>
                    <td>
                        <xsl:value-of select="q_11_1_referenceNumber"/>
                    </td>
                    <td>
                        <xsl:value-of select="q_11_1_referenceIED"/>
                    </td>
                    <td>
                        <xsl:value-of select="q_11_1_plantName"/>
                    </td>
                    <td>
                        <xsl:call-template name="getYesNoValue">
                            <xsl:with-param name="elem" select="q_11_1_capBelow2Tonnes"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:value-of select="q_11_1_permittedWasteCap"/>
                    </td>
                    <td>
                        <xsl:value-of select="q_11_1_permittedHazardousWasteCap"/>
                    </td>
                    <td>
                        <xsl:value-of select="ActivePermitPlant/q_11_1_link"/>
                    </td>
                    <td>
                        <xsl:value-of select="ActivePermitPlant/q_11_1_permitDate"/>
                    </td>
                    <td>
                        <xsl:call-template name="getCDLValue">
                            <xsl:with-param name="elem" select="q_11_1_plantType"/>
                            <xsl:with-param name="codelistURL" select="$TypeOfPlantCodeURL"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:call-template name="getYesNoValue">
                            <xsl:with-param name="elem" select="q_11_1_hazardousWaste"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:call-template name="getYesNoValue">
                            <xsl:with-param name="elem" select="q_11_1_nonHazardousWaste"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:value-of select="q_11_1_latitude"/>
                    </td>
                    <td>
                        <xsl:value-of select="q_11_1_longitude"/>
                    </td>
                    <td>
                        <xsl:value-of select="Address/street"/>
                    </td>
                    <td>
                        <xsl:value-of select="Address/streetNumber"/>
                    </td>
                    <td>
                        <xsl:value-of select="Address/townVillage"/>
                    </td>
                    <td>
                        <xsl:value-of select="Address/postalCode"/>
                    </td>
                    <td>
                        <xsl:call-template name="getYesNoValue">
                            <xsl:with-param name="elem" select="q_11_1_benefit51_1"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:call-template name="getYesNoValue">
                            <xsl:with-param name="elem" select="q_11_1_benefit51_2"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:call-template name="getYesNoValue">
                            <xsl:with-param name="elem" select="q_11_1_benefit51_3"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:value-of select="ActualOperationConditions/OrganicCarbon/q_11_1_actualConditions"/>
                    </td>
                    <td>
                        <xsl:call-template name="getCDLValue">
                            <xsl:with-param name="elem" select="ActualOperationConditions/OrganicCarbon/q_11_1_results"/>
                            <xsl:with-param name="codelistURL" select="$ResultsOfVerificationsCodeURL"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:value-of select="ActualOperationConditions/Temperature/q_11_1_actualConditions"/>
                    </td>
                    <td>
                        <xsl:call-template name="getCDLValue">
                            <xsl:with-param name="elem" select="ActualOperationConditions/Temperature/q_11_1_results"/>
                            <xsl:with-param name="codelistURL" select="$ResultsOfVerificationsCodeURL"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:value-of select="ActualOperationConditions/WasteIncineration/q_11_1_actualConditions"/>
                    </td>
                    <td>
                        <xsl:call-template name="getCDLValue">
                            <xsl:with-param name="elem" select="ActualOperationConditions/WasteIncineration/q_11_1_results"/>
                            <xsl:with-param name="codelistURL" select="$ResultsOfVerificationsCodeURL"/>
                        </xsl:call-template>
                    </td>
                    <td>
                        <xsl:value-of select="ActualOperationConditions/AutomaticSystem/q_11_1_actualConditions"/>
                    </td>
                    <td>
                        <xsl:call-template name="getCDLValue">
                            <xsl:with-param name="elem" select="ActualOperationConditions/AutomaticSystem/q_11_1_results"/>
                            <xsl:with-param name="codelistURL" select="$ResultsOfVerificationsCodeURL"/>
                        </xsl:call-template>
                    </td>
                </tr>
            </xsl:for-each>
        </table>

        <!-- question 11.2a -->
        <h3>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question11-2a'"/>
            </xsl:call-template>
        </h3>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'plants-ex-2T'"/>
            </xsl:call-template>
        </h4>

        <table id="question11-2a">
            <tr>
                <th colspan="2"></th>
                <th colspan="4">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'amountPerYearTotal'"/>
                    </xsl:call-template>
                </th>
                <th colspan="4">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'amountPerYearHazardous'"/>
                    </xsl:call-template>
                </th>
                <th colspan="4">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'amountPerYearNonhazardous'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2a'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2d'"/>
                    </xsl:call-template>
                </th>
                <th>2013</th>
                <th>2014</th>
                <th>2015</th>
                <th>2016</th>
                <th>2013</th>
                <th>2014</th>
                <th>2015</th>
                <th>2016</th>
                <th>2013</th>
                <th>2014</th>
                <th>2015</th>
                <th>2016</th>
            </tr>
            <xsl:for-each select="./Plant">
                <xsl:if test="q_11_1_capBelow2Tonnes = false()">
                    <tr>
                        <td><xsl:value-of select="q_11_1_referenceNumber"/></td>
                        <td><xsl:value-of select="q_11_1_plantName"/></td>
                        <xsl:for-each select="./WasteIncinarated/TotalWaste">
                            <td><xsl:value-of select="q_11_2a_amount"/></td>
                        </xsl:for-each>
                        <xsl:for-each select="./WasteIncinarated/HazardousWaste">
                            <td><xsl:value-of select="q_11_2a_amount"/></td>
                        </xsl:for-each>
                        <xsl:for-each select="./WasteIncinarated/NonHazardousWaste">
                            <td><xsl:value-of select="q_11_2a_amount"/></td>
                        </xsl:for-each>
                    </tr>
                </xsl:if>
            </xsl:for-each>
        </table>

        <!-- question 11.2b -->
        <h3>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question11-2b'"/>
            </xsl:call-template>
        </h3>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'plants-ex-2T'"/>
            </xsl:call-template>
        </h4>
        <table id="question11-2b">
            <tr>
                <th colspan="2"></th>
                <th colspan="5">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'accOfRunHours'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <th colspan="3"></th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'numBreaks'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'breakdownDur'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2a'"/>
                    </xsl:call-template> 
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2d'"/>
                    </xsl:call-template> 
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'operHours'"/>
                    </xsl:call-template> 
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'numBreaks'"/>
                    </xsl:call-template> 
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'infoNoAvail'"/>
                    </xsl:call-template> 
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'breakdownDur'"/>
                    </xsl:call-template> 
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'infoNoAvail'"/>
                    </xsl:call-template> 
                </th>
            </tr>
            <xsl:for-each select="./Plant">
                <xsl:if test="q_11_1_capBelow2Tonnes = false()">
                    <tr>
                        <td><xsl:value-of select="q_11_1_referenceNumber"/></td>
                        <td><xsl:value-of select="q_11_1_plantName"/></td>
                        <td><xsl:value-of select="AccountOfRunningProcess/q_11_2_operationalHours"/></td>
                        <td><xsl:value-of select="AccountOfRunningProcess/q_11_2_breakdowns"/></td>
                        <td>
                            <xsl:call-template name="getYesNoValue">
                                <xsl:with-param name="elem" select="AccountOfRunningProcess/q_11_2_breakDownInfoNotAvailable"/>
                            </xsl:call-template>
                        </td>
                        <td><xsl:value-of select="AccountOfRunningProcess/q_11_2_cumulativeBreakdown"/></td>
                        <td>
                            <xsl:call-template name="getYesNoValue">
                                <xsl:with-param name="elem" select="AccountOfRunningProcess/q_11_2_cummulativeBreakDownInfoNotAvailable"/>
                            </xsl:call-template>
                        </td>
                    </tr>
                </xsl:if>
            </xsl:for-each>
        </table>

        <!-- question 11.2c -->
        <h3>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question11-2c'"/>
            </xsl:call-template>
        </h3>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'plants-ex-2T-benefits'"/>
            </xsl:call-template>
        </h4>
        
        <table id="question11-2c">
            <tr>
                <th colspan="2"></th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-2c-i'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-2c-ii'"/>
                    </xsl:call-template>
                </th>
                <th colspan="2">
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-2c-iii'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2a'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2d'"/>
                    </xsl:call-template>
                </th>
                <th></th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'airPolSub'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'waterPolSub'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-2c-ii-desc'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-2c-iii-link'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <xsl:for-each select="./Plant">
                <xsl:if test="q_11_1_capBelow2Tonnes = false() and (q_11_1_benefit51_1='true' or q_11_1_benefit51_2='true' or q_11_1_benefit51_3='true')">
                    <tr>
                        <td><xsl:value-of select="q_11_1_referenceNumber"/></td>
                        <td><xsl:value-of select="q_11_1_plantName"/></td>
                        <td>
                            <xsl:call-template name="getYesNoValue">
                                <xsl:with-param name="elem" select="ELVlevel/q_11_2c_1_ELVcompliant"/>
                            </xsl:call-template>
                        </td>
                        <td>
                            <ul>
                                <xsl:for-each select="ELVlevel/AirPollutants/q_11_2c_2_airPollutant">
                                    <li>
                                        <xsl:call-template name="getCDLValue">
                                            <xsl:with-param name="elem" select="."/>
                                            <xsl:with-param name="codelistURL" select="$AirPollutingSubstancesCodeURL"/>
                                        </xsl:call-template>
                                    </li>
                                </xsl:for-each>
                            </ul>
                        </td>
                        <td>
                            <ul>
                                <xsl:for-each select="ELVlevel/WaterPollutants/q_11_2c_2_waterPollutant">
                                    <li>
                                        <xsl:call-template name="getCDLValue">
                                            <xsl:with-param name="elem" select="."/>
                                            <xsl:with-param name="codelistURL" select="$WaterPollutingSubstancesCodeURL"/>
                                        </xsl:call-template>
                                    </li>
                                </xsl:for-each>
                            </ul>
                        </td>
                        <td><xsl:value-of select="ELVlevel/q_11_2c_3_description"/></td>
                        <td><xsl:value-of select="ELVlevel/q_11_2c_3_link"/></td>
                    </tr>
                </xsl:if>
            </xsl:for-each>
        </table>
    </xsl:template>
    <xsl:template match="IEDModule4/SolventEmissions">
        <!-- question 12.1 -->
        <h2>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question12-heading'"/>
            </xsl:call-template>
        </h2>
        <h3>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question12-1'"/>
            </xsl:call-template>
        </h3>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question12-1a'"/>
            </xsl:call-template>
        </h4>
        <p>
            <xsl:call-template name="getYesNoValue">
                <xsl:with-param name="elem" select="q_12_1_reductionSchemeApplied"/>
            </xsl:call-template>
        </p>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question12-1b'"/>
            </xsl:call-template>
        </h4>

        <table id="question12-1">
            <tr>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'totalNumOfinst'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'numOfInstArt59'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'remarks'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <tr>
                <td><xsl:value-of select="Progress/q_12_1_numberOfInstallations"/></td>
                <td><xsl:value-of select="Progress/q_12_1_numberCovered"/></td>
                <td><xsl:value-of select="Progress/q_12_1_remarks"/></td>
            </tr>
        </table>

        <!-- question 12.2 -->
        <h3>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'question12-2'"/>
            </xsl:call-template>
        </h3>
        <h4>
            <xsl:call-template name="getLabel">
                <xsl:with-param name="labelName" select="'eachPlantProvide'"/>
            </xsl:call-template>
        </h4>
        <table id="question12-2">
            <tr>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question12-2a'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question12-2b'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'plantName'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2e'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question11-1-2f'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'operatorName'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question12-2c'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'derogType'"/>
                    </xsl:call-template>
                </th>
                <th>
                    <xsl:call-template name="getLabel">
                        <xsl:with-param name="labelName" select="'question12-2d'"/>
                    </xsl:call-template>
                </th>
            </tr>
            <xsl:for-each select="./DerogationPlant">
                <tr>
                    <td><xsl:value-of select="q_12_2_referenceNumber"/></td>
                    <td><xsl:value-of select="q_12_2_refNumberIED"/></td>
                    <td><xsl:value-of select="q_12_2_plantName"/></td>
                    <td><xsl:value-of select="q_12_2_longitude"/></td>
                    <td><xsl:value-of select="q_12_2_latitude"/></td>
                    <td><xsl:value-of select="q_12_2_operatorName"/></td>
                    <td><xsl:value-of select="q_12_2_competentAuthority"/></td>
                    <td>
                        <xsl:call-template name="getCDLValue">
                            <xsl:with-param name="elem" select="q_12_2_derogationType"/>
                            <xsl:with-param name="codelistURL" select="$DerogationTypeURL"/>
                        </xsl:call-template> 
                    </td>
                    <td><xsl:value-of select="q_12_2_justification"/></td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>