View stylesheet

XML schema http://dd.eionet.europa.eu/schemas/habides-2.0/derogations.xsd
Output type HTML
Description HABIDES+ reporting tool HTML
XSL file derogations_2.xsl (Last modified: 14 Nov 2018 13:20 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                xmlns:skos="http://www.w3.org/2004/02/skos/core#"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <!-- $Id: derogations_2.xsl 24302 2018-11-14 12:09:12Z sofiageo $
         For schema http://dd.eionet.europa.eu/schemas/habides-2.0/derogations.xsd
      -->
    <xsl:output method='html' encoding='UTF-8' indent='yes'/>

    <xsl:variable name="habitatsURL" select="'http://rod.eionet.europa.eu/obligations/268'"/>
    <xsl:variable name="birdsURL" select="'http://rod.eionet.europa.eu/obligations/276'"/>

    <xsl:template match="/">
        <html>
            <head>
                <style>
                    ul {margin: 0; padding: 0 0 0 1.2em;}
                    span.lbl {float: right; font-weight: bold; text-align: right; padding-right: 3px; width: 100%}
                    table.tbl tr td {border: solid 1px #cccccc;}
                    .colorRow{
                    color: #31708f;
                    background-color: #d9edf7;
                    border-color: #bce8f1;
                    height:1em;
                    }
                    .startRow{
                    color: #31708f;
                    background-color: #31708f;
                    border-color: #31708f;
                    height:1em;
                    }
                    .tdWidth{
                    width: 24%;
                    }
                    .bold{
                        font-weight: bold;
                        float:left;
                    }
                </style>
            </head>
            <body>
                <h2>Habitats and Birds Derogations</h2>


                <xsl:for-each select="derogations/derogation">
                    <div style="padding-bottom: 7px">
                        <table border="0" cellspacing="1" cellpadding="1" class="tbl">
                            <tr>
                                <td colspan="2" class="startRow"/>
                            </tr>
                            <tr>
                                <td class="tdWidth">
                                    <h3>
                                        <span class="lbl">Directive</span>
                                    </h3>
                                </td>
                                <td>
                                    <xsl:choose>
                                        <xsl:when test="./@directive = $habitatsURL or ./@directive = $birdsURL">
                                            <a>
                                                <xsl:attribute name="href">
                                                    <xsl:value-of select="./@directive"/>
                                                </xsl:attribute>
                                                <xsl:attribute name="target">new</xsl:attribute>
                                                <xsl:value-of select="./@directive"/>
                                            </a>
                                            <xsl:if test="./@directive = $habitatsURL">
                                                (habitats)
                                            </xsl:if>
                                            <xsl:if test="./@directive = $birdsURL">
                                                (birds)
                                            </xsl:if>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="./@directive"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Derogation reference</span>
                                </td>
                                <td>
                                    <xsl:value-of select="./@derogation_reference"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">User derogation reference</span>
                                </td>
                                <td>
                                    <xsl:value-of select="./@user_derogation_ref"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">User identity</span>
                                </td>
                                <td>
                                    <xsl:value-of select="./@userIdentity"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Species covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./species"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Species group covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./speciesGroup"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <xsl:if test="./@directive = $birdsURL">
                                <td>
                                    <span class="lbl">This derogation covers all species of birds</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./coversAllSpecies"/>
                                    </xsl:call-template>
                                </td>
                            </xsl:if>
                            <tr>
                                <td>
                                    <span class="lbl">"sensitive" derogation not to be published?</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./sensitive"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Derogation valid from (date)</span>
                                </td>
                                <td>
                                    <xsl:choose>
                                        <xsl:when test="contains(licenseValidFrom,'T')"><xsl:value-of select="substring-before(licenseValidFrom, 'T')"/></xsl:when>
                                        <xsl:otherwise><xsl:value-of select="licenseValidFrom"/></xsl:otherwise>
                                    </xsl:choose>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Derogation valid to (date)</span>
                                </td>
                                <td>
                                    <xsl:choose>
                                        <xsl:when test="contains(licenseValidUntil,'T')"><xsl:value-of select="substring-before(licenseValidUntil, 'T')"/></xsl:when>
                                        <xsl:otherwise><xsl:value-of select="licenseValidUntil"/></xsl:otherwise>
                                    </xsl:choose>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Authority granting the derogation</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensingAuthority"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Country</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getCodelist">
                                        <xsl:with-param name="code" select="@country"/>
                                        <xsl:with-param name="codelist" select="'habidescountries'"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Region(s)</span>
                                </td>
                                <td>
                                    <ul>
                                        <xsl:for-each select="./regions/region">
                                            <li>
                                                <xsl:value-of select="."/>
                                            </li>
                                        </xsl:for-each>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Location</span>
                                </td>
                                <td>
                                    <xsl:value-of select="location"/>
                                </td>
                            </tr>
                            <xsl:if test="./@directive = $birdsURL">
                                <tr>
                                    <td colspan="2" class="colorRow"/>
                                </tr>
                                <tr>
                                    <td>
                                        <span class="lbl">Why is this derogation required?</span>
                                    </td>
                                    <td>
										<ul>
											<xsl:for-each select="./derogationJustifications/derogationJustification">
												<li>
													<xsl:call-template name="getCodelist">
														<xsl:with-param name="code" select="."/>
														<xsl:with-param name="codelist" select="'derogationjustification'"/>
													</xsl:call-template>
												</li>
											</xsl:for-each>
										</ul>
                                    </td>
                                </tr>
                            </xsl:if>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Legal justification for granting the derogation</span>
                                </td>
                                <td>


                                    <xsl:if test="./@directive = $habitatsURL">
										<ul>
											<xsl:for-each select="./reasons/reason">
												<li>
													<xsl:call-template name="getCodelist">
														<xsl:with-param name="code" select="."/>
														<xsl:with-param name="codelist" select="'habitatslegalbasis'"/>
													</xsl:call-template>
												</li>
											</xsl:for-each>
										</ul>
                                    </xsl:if>
                                    <xsl:if test="./@directive = $birdsURL">
										<ul>
											<xsl:for-each select="./reasons/reason">
												<li>
													<xsl:call-template name="getCodelist">
														<xsl:with-param name="code" select="."/>
														<xsl:with-param name="codelist" select="'birdslegalbasis'"/>
													</xsl:call-template>
												</li>
											</xsl:for-each>
										</ul>
                                    </xsl:if>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Further details on the legal justification</span>
                                </td>
                                <td>
                                    <xsl:value-of select="derogationJustificationDetails"/>
                                </td>
                            </tr>

                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td colspan="2">

                                    <xsl:if test="./@directive = $habitatsURL">
                                        <span class="lbl">If the derogation is granted on the basis of Article 16.1.e of the EU Habitats Directive (or the equivalent provision under Art. 9.1. last sentence of the Bern Convention), provide evidence that the following requirements </span>
                                    </xsl:if>
                                    <xsl:if test="./@directive = $birdsURL">
                                        <span class="lbl">If the derogation is granted on the basis of Article 9.1.c of the EU Birds Directive (or the equivalent provision under Art. 9.1. last sentence under the Bern Convention), provide evidence that the following requirements are fulfilled:</span>
                                    </xsl:if>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">The application of the derogation is subject to "strictly supervised conditions"</span>
                                </td>
                                <td>
                                    <xsl:value-of select="strictlySupervisedConditions"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">The application of the derogation occurs on a "selective basis"</span>
                                </td>
                                <td>
                                    <xsl:value-of select="selectiveBasis"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">The derogation only applies to a "small, limited number" of individuals</span>
                                </td>
                                <td>
                                    <xsl:value-of select="smallNumberIndividuals"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Main activity covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:if test="./@directive = $habitatsURL">
                                        <xsl:call-template name="getCodelist">
                                            <xsl:with-param name="code" select="./activities/activity"/>
                                            <xsl:with-param name="codelist" select="'habitatsmainactivities'"/>
                                        </xsl:call-template>
                                    </xsl:if>
                                    <xsl:if test="./@directive = $birdsURL">
                                        <xsl:call-template name="getCodelist">
                                            <xsl:with-param name="code" select="./activities/activity"/>
                                            <xsl:with-param name="codelist" select="'birdsmainactivities'"/>
                                        </xsl:call-template>
                                    </xsl:if>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Additional activities covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:if test="./@directive = $habitatsURL">
										<ul>
											<xsl:for-each select="./additionalActivities/activity">
												<li>
													<xsl:call-template name="getCodelist">
														<xsl:with-param name="code" select="."/>
														<xsl:with-param name="codelist" select="'habitatsmainactivities'"/>
													</xsl:call-template>
												</li>
											</xsl:for-each>
										</ul>
                                    </xsl:if>
                                    <xsl:if test="./@directive = $birdsURL">
										<ul>
											<xsl:for-each select="./additionalActivities/activity">
												<li>
													<xsl:call-template name="getCodelist">
														<xsl:with-param name="code" select="."/>
														<xsl:with-param name="codelist" select="'birdsmainactivities'"/>
													</xsl:call-template>
												</li>
											</xsl:for-each>
										</ul>
                                    </xsl:if>
                                </td>
                            </tr>
							<tr>
								<td>
									<span class="lbl">Further details on the main activities covered by the derogation</span>
								</td>
								<td>
									<xsl:value-of select="activitiesFurtherDetails"/>
								</td>
							</tr>

                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Mean, arrangement or method covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:if test="./@directive = $habitatsURL">
                                        <xsl:call-template name="getCodelist">
                                            <xsl:with-param name="code" select="./methods/method"/>
                                            <xsl:with-param name="codelist" select="'habitatsmethods'"/>
                                        </xsl:call-template>
                                    </xsl:if>
                                    <xsl:if test="./@directive = $birdsURL">
                                        <xsl:call-template name="getCodelist">
                                            <xsl:with-param name="code" select="./methods/method"/>
                                            <xsl:with-param name="codelist" select="'birdsmethods'"/>
                                        </xsl:call-template>
                                    </xsl:if>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Further details on the prohibited means, arrangements or methods covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:value-of select="furtherDetails"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Modes of transport covered by the derogation</span>
                                </td>
                                <td>
                                    <xsl:if test="./@directive = $habitatsURL">
                                        <xsl:call-template name="getCodelist">
                                            <xsl:with-param name="code" select="./modesOfTransport/modeOfTransport"/>
                                            <xsl:with-param name="codelist" select="'habitatsmodesoftransport'"/>
                                        </xsl:call-template>
                                    </xsl:if>
                                    <xsl:if test="./@directive = $birdsURL">
                                        <xsl:call-template name="getCodelist">
                                            <xsl:with-param name="code" select="./modesOfTransport/modeOfTransport"/>
                                            <xsl:with-param name="codelist" select="'birdsmodesoftransport'"/>
                                        </xsl:call-template>
                                    </xsl:if>
                                </td>
                            </tr>

                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td colspan="2"><span class="bold">Maximum number of individuals, eggs, nests, breeding sites, resting sites covered by the derogation, during the period covered by the derogation</span></td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Individuals</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/individuals"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Eggs</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/eggs"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Nests</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/nests"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Breeding sites</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/breeding"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Resting sites</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/resting"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Others (unit)</span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/otherType"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">No figure can be provided</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./licensed/noFigureProvided"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Justification, in case no figure can be provided for the
                                        maximum number of indivuals, eggs, nests, breeding sites, resting sites covered by
                                        the derogation
                                    </span>
                                </td>
                                <td>
                                    <xsl:value-of select="licensed/licensedJustification"/>
                                </td>
                            </tr>

                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td colspan="2"><span class="bold" >Number of individuals, eggs, nests, breeding sites, resting sites actually affected as a result of the derogation, and during the reporting period covered</span></td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Individuals</span>
                                </td>
                                <td>
                                    <xsl:value-of select="actuallyTaken/individuals"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Eggs</span>
                                </td>
                                <td>
                                    <xsl:value-of select="actuallyTaken/eggs"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Nests</span>
                                </td>
                                <td>
                                    <xsl:value-of select="actuallyTaken/nests"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Breeding sites</span>
                                </td>
                                <td>
                                    <xsl:value-of select="actuallyTaken/breeding"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Resting sites</span>
                                </td>
                                <td>
                                    <xsl:value-of select="actuallyTaken/resting"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Others (unit)</span>
                                </td>
                                <td>
                                    <xsl:value-of select="actuallyTaken/otherType"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">No figure can be provided</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./actuallyTaken/noFigureProvided"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Justification, in case no figure can be provided for the
                                        maximum number of indivuals, eggs, nests, breeding sites, resting sites covered by
                                        the derogation
                                    </span>
                                </td>
                                <td>
                                    <xsl:value-of select="./actuallyTaken/licensedJustification"/>
                                </td>
                            </tr>

                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">I declare that all measures (including supervisory measures) have been taken to ensure that the derogation is fully compliant with the legal requirements under the Bern Convention
                                    </span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./allMeasuresTaken"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">I declare that all measures (including supervisory measures) have been taken to ensure that the derogation is fully compliant with the legal requirements under the EU Habitats Directive
                                    </span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./EUAllMeasuresTaken"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">If the population affected by the derogation is endangered or declining, provide evidence that the derogation is not detrimental to the population
                                    </span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./detrimentalToPopulation"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">I declare that there is no other satisfactory alternative to the derogation</span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./alternativeToDerogation"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">If appropriate, provide a reference to alternatives rejected
                                    </span>
                                </td>
                                <td>
                                    <xsl:call-template name="getValue">
                                        <xsl:with-param name="elem" select="./alternativesAssessed"/>
                                    </xsl:call-template>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Controls carried out and results obtained by the controls</span>
                                </td>
                                <td>
                                    <xsl:value-of select="supervisoryMeasure"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="colorRow"/>
                            </tr>
                            <tr>
                                <td>
                                    <span class="lbl">Comments and notes</span>
                                </td>
                                <td>
                                    <xsl:value-of select="comments"/>
                                </td>
                            </tr>
                        </table>
                    </div>
                </xsl:for-each>
            </body>
        </html>
    </xsl:template>

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

    </xsl:template>

    <xsl:template name="getCodelist">
        <xsl:param name="code" select="''"/>
        <xsl:param name="codelist"/>
        <xsl:variable name="habitatslegalBasis" select="'http://dd.eionet.europa.eu/vocabulary/habides/'"/>
        <xsl:variable name="habitatslegalBasisCode" select="concat($habitatslegalBasis,$codelist,'/', $code)"/>
        <xsl:variable name="habitatslegalBasisURL" select="document(concat('https://dd.eionet.europa.eu/vocabulary/habides/',$codelist ,'/rdf' ))/rdf:RDF"/>

        <xsl:choose>
            <xsl:when test="false()"></xsl:when>
            <xsl:otherwise>
                <xsl:choose>
                    <xsl:when test="not($habitatslegalBasisURL/skos:Concept[@rdf:about = $habitatslegalBasisCode]/skos:prefLabel[@xml:lang = 'en'])">
                        <xsl:value-of select="$habitatslegalBasisURL/skos:Concept[@rdf:about = $habitatslegalBasisCode]/skos:prefLabel"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$habitatslegalBasisURL/skos:Concept[@rdf:about = $habitatslegalBasisCode]/skos:prefLabel[@xml:lang = 'en']"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>

</xsl:stylesheet>