View stylesheet

XML schema http://dd.eionet.europa.eu/schemas/habitatsdirective/art12_birds.xsd
Output type HTML
Description HTML Factsheet
XSL file birds-2018.xsl (Last modified: 20 Mar 2019 11:28 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml" xmlns:lookup="http://biodiversity.eionet.europa.eu/art12dataflow"
    version="1.0" exclude-result-prefixes="xml lookup">

    <xsl:import href="art12_redlist-common-2018.xsl"/>
    <xsl:variable name="report_type" select="'birds'"/>

    <xsl:output method="xml" 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:param name="envelopeurl"/>
    <xsl:param name="envelopepath"/>
    <xsl:param name="filename"/>

    <xsl:variable name="isRedList"><xsl:value-of select="/bird_reports/@redlist = 'true'"/></xsl:variable>

    <xsl:template match="bird_reports">
        <html>
            <xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>

            <head>
                <meta charset="UTF-8"/>
                <title>Factsheet</title>
                <xsl:call-template name="getCss"/>
            </head>
            <body>
                <xsl:choose>
                    <xsl:when test="$isRedList = 'false'">
                        <h1>Annex B - Bird species' status and trends report format (Article 12) for the period 2013 - 2018</h1>
                    </xsl:when>
                    <xsl:otherwise>
                        <h1>Bird species' status and trends</h1>
                    </xsl:otherwise>
                </xsl:choose>
                <h2>Bird species on this report</h2>
                <xsl:for-each select="bird_report">
                    <xsl:variable name="seasonText">
                        <xsl:call-template name="getValueLabel">
                            <xsl:with-param name="elem" select="season"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <p>
                       <a>
                           <xsl:attribute name="href"><xsl:value-of select="concat('#',speciescode,'_', season)"/></xsl:attribute>
                           <xsl:value-of select="concat(speciesname, ' (', speciescode, ')', $seasonText)"/>
                        </a>
                    </p>
                </xsl:for-each>
                <xsl:apply-templates/>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="bird_report">
        <xsl:variable name="season">
            <xsl:choose>
                <xsl:when test="$isRedList = 'false' and empty(index-of(('B','P','W'), upper-case(season)))">B</xsl:when>
                <xsl:when test="$isRedList = 'true' and empty(index-of(('B','W'), upper-case(season)))">B</xsl:when>
                <xsl:otherwise><xsl:value-of select="upper-case(season)"/></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="speciesref" select="concat(speciescode,'_', season)"/>
        <h2 id="{$speciesref}">1. Species information</h2>
        <table>
              <tbody>
                <xsl:apply-templates select="country"/>
                <xsl:apply-templates select="speciescode"/>
                <xsl:apply-templates select="euringcode"/>
                <xsl:apply-templates select="speciesname"/>
                <xsl:apply-templates select="sub_unit"/>
                <xsl:apply-templates select="alternative_speciesname"/>
                <xsl:apply-templates select="common_speciesname"/>
                <xsl:apply-templates select="season"/>
            </tbody>
        </table>
        
        <h2>2. Population size</h2>
        <table>
            <tbody>
                <xsl:apply-templates select="population_date"/>
                <xsl:apply-templates select="population_size_unit"/>
                <xsl:apply-templates select="population_size_min"/>
                <xsl:apply-templates select="population_size_max"/>
                <xsl:apply-templates select="population_size"/>
                <xsl:apply-templates select="population_estimate_type"/>
                <xsl:apply-templates select="population_method"/>
                <xsl:apply-templates select="population_sources"/>
                <tr>
                    <xsl:choose>
                        <xsl:when test="population_reasons_for_change/no_change='true'"><th>2.6 Change and reason for change (since previous report)</th></xsl:when>
                        <xsl:otherwise><th rowspan="6">2.6 Change and reason for change (since previous report)</th></xsl:otherwise>
                    </xsl:choose>
                    <td>Is there a change between reporting periods?</td>
                    <td>
                        <span class="value">
                            <xsl:choose>
                                <xsl:when test="population_reasons_for_change/no_change='true'">No</xsl:when>
                                <xsl:otherwise>Yes</xsl:otherwise>
                            </xsl:choose>
                        </span>
                    </td>
                </tr>
                <xsl:if test="population_reasons_for_change/no_change='false'">
                    <tr>
                        <td>a) yes, due to genuine change</td>
                        <td><xsl:call-template name="getValue"><xsl:with-param name="elem" select="population_reasons_for_change/genuine"/></xsl:call-template></td>
                    </tr>
                    <tr>
                        <td>b) yes, due to improved knowledge/more accurate data</td>
                        <td><xsl:call-template name="getValue"><xsl:with-param name="elem" select="population_reasons_for_change/knowledge"/></xsl:call-template></td>
                    </tr>
                    <tr>
                        <td>c) yes, due to the use of different method</td>
                        <td><xsl:call-template name="getValue"><xsl:with-param name="elem" select="population_reasons_for_change/method"/></xsl:call-template></td>
                    </tr>
                    <tr>
                        <td>d) yes, but there is no information on the nature of change</td>
                        <td><xsl:call-template name="getValue"><xsl:with-param name="elem" select="population_reasons_for_change/no_info"/></xsl:call-template></td>
                    </tr>
                    <tr>
                        <td colspan="2">The change is mainly due to: <xsl:call-template name="getValue"><xsl:with-param name="elem" select="population_reasons_for_change/main_reason/@desc"/></xsl:call-template></td>
                    </tr>
                </xsl:if>
                <xsl:apply-templates select="population_info"/>
            </tbody>
        </table>

        <h2>3. Population trend</h2>
        <table>
            <tbody>
                <tr><th colspan="2" class="header_3">3.1 Short-term trend (last 12 years)</th></tr>
                <xsl:apply-templates select="population_trend_period"/>
                <xsl:apply-templates select="population_trend"/>
                <xsl:apply-templates select="population_trend_magnitude_min"/>
                <xsl:apply-templates select="population_trend_magnitude_max"/>
                <xsl:apply-templates select="population_trend_magnitude"/>
                <xsl:apply-templates select="population_trend_method"/>
                <xsl:apply-templates select="population_trend_sources"/>
                <tr><th colspan="2" class="header_3">3.2 Long-term trend (since c. 1980)</th></tr>
                <xsl:apply-templates select="population_trend_long_period"/>
                <xsl:apply-templates select="population_trend_long"/>
                <xsl:apply-templates select="population_trend_long_magnitude_min"/>
                <xsl:apply-templates select="population_trend_long_magnitude_max"/>
                <xsl:apply-templates select="population_trend_long_magnitude"/>
                <xsl:apply-templates select="population_trend_long_method"/>
                <xsl:apply-templates select="population_trend_long_sources"/>
                <xsl:apply-templates select="population_trend_info"/>
            </tbody>
        </table>
        
        <!-- sections 4 B only and not relevant for RedList-->
        <xsl:if test="$season = 'B' and $isRedList = 'false'">
            <h2>4. Breeding distribution map and size</h2>
            <table>
                <tbody>
                    <xsl:apply-templates select="sensitive_species"/>
                    <xsl:apply-templates select="distribution_period"/>
                    <xsl:apply-templates select="distribution_map"/>
                    <xsl:apply-templates select="distribution_surface_area"/>
                    <xsl:apply-templates select="distribution_method"/>
                    <xsl:apply-templates select="additional_distribution_map"/>
                    <xsl:apply-templates select="distribution_source"/>
                    <xsl:apply-templates select="distribution_info"/>
                </tbody>
            </table>
        </xsl:if>

        <!-- sections 5 B only -->
        <xsl:if test="$season = 'B'">
            <h2>5. Breeding distribution trend</h2>
            <table>
                <tbody>
                    <tr><th colspan="2" class="header_3">5.1 Short-term trend (last 12 years)</th></tr>
                    <xsl:apply-templates select="distribution_trend_period"/>
                    <xsl:apply-templates select="distribution_trend"/>
                    <xsl:apply-templates select="distribution_trend_magnitude_min"/>
                    <xsl:apply-templates select="distribution_trend_magnitude_max"/>
                    <xsl:apply-templates select="distribution_trend_magnitude"/>
                    <xsl:apply-templates select="distribution_trend_method"/>
                    <xsl:apply-templates select="distribution_trend_source"/>
                    <tr><th colspan="2" class="header_3">5.2 Long-term trend (since c. 1980)</th></tr>
                    <xsl:apply-templates select="distribution_trend_long_period"/>
                    <xsl:apply-templates select="distribution_trend_long"/>
                    <xsl:apply-templates select="distribution_trend_long_magnitude_min"/>
                    <xsl:apply-templates select="distribution_trend_long_magnitude_max"/>
                    <xsl:apply-templates select="distribution_trend_long_magnitude"/>
                    <xsl:apply-templates select="distribution_trend_long_method"/>
                    <xsl:apply-templates select="distribution_trend_long_source"/>
                    <xsl:apply-templates select="distribution_trend_info"/>
                </tbody>
            </table>
        </xsl:if>

        <!-- sections 6 not relevant for RedList -->
        <xsl:if test="$isRedList = 'false'">
            <h2>6. Progress in work related to international Species Action Plans (SAPs), Management Plans (MPs) and Brief Management Statements (BMSs)</h2>
            <table>
                <tbody>
                    <xsl:apply-templates select="plan"/>
                    <xsl:apply-templates select="national_plan_adopted"/>
                    <xsl:apply-templates select="measures_taken"/>
                    <xsl:apply-templates select="effectiveness_SAPs"/>
                    <xsl:apply-templates select="effectiveness_MPs"/>
                    <xsl:apply-templates select="further_info"/>
                </tbody>
            </table>
        </xsl:if>
        
        <h2>7. Main pressures and threats</h2>
        <table>
            <tbody>
                <tr>
                    <th colspan="3">7.1 Characterisation of pressures/threats</th>
                </tr>
                <xsl:apply-templates select="pressures"/>
                <xsl:apply-templates select="threats"/>
                <xsl:apply-templates select="pressures_threats_info/pressures_source"/>
                <xsl:apply-templates select="pressures_threats_info/pressures_info"/>
            </tbody>
        </table>

        <h2>8. Conservation measures</h2>
        <table>
            <tbody>
                <xsl:apply-templates select="conservation_measures/measures_needed"/>
                <xsl:apply-templates select="conservation_measures/measures_status"/>
                <xsl:apply-templates select="conservation_measures/measures_purpose"/>
                <xsl:apply-templates select="conservation_measures/measures_location"/>
                <xsl:apply-templates select="conservation_measures/measures_response"/>
                <tr>
                    <th>8.5 List of main conservation measures</th>
                    <td><xsl:apply-templates select="conservation_measures/measures/measure"/></td>
                </tr>
                <xsl:apply-templates select="conservation_measures/measures_info"/>
            </tbody>
        </table>

        <h2>9. Natura 2000 (SPAs) coverage</h2>
        <table>
            <tbody>
                <xsl:apply-templates select="spa_population_unit"/>
                <xsl:apply-templates select="spa_population_min"/>
                <xsl:apply-templates select="spa_population_max"/>
                <xsl:apply-templates select="spa_population"/>
                <xsl:apply-templates select="spa_population_estimate_type"/>
                <xsl:apply-templates select="spa_population_method"/>
                <xsl:apply-templates select="spa_population_trend"/>
                <xsl:apply-templates select="spa_population_trend_method"/>
                <xsl:apply-templates select="spa_info"/>
            </tbody>
        </table>
            
        <xsl:if test="data_birds_annexII/*">
            <h2>10. Information related to Annex II species (Art.7)</h2>
            <table>
                <tbody>
                    <xsl:apply-templates select="data_birds_annexII/nationally_hunted"/>
                    <tr>
                        <th>10.2 Hunting bag</th>
                        <td colspan="2">
                            <table>
                                <tbody>
                                    <tr>
                                        <th>a) Unit</th>
                                        <td colspan="6"><xsl:call-template name="getValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_unit"/></xsl:call-template></td>
                                    </tr>
                                    <tr>
                                        <th>b) Statistics/quantity taken</th>
                                        <td>Season/year 1</td>
                                        <td>Season/year 2</td>
                                        <td>Season/year 3</td>
                                        <td>Season/year 4</td>
                                        <td>Season/year 5</td>
                                        <td>Season/year 6</td>
                                    </tr>
                                    <tr>
                                        <th>Min. (raw, ie. not rounded)</th>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y1_min"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y2_min"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y3_min"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y4_min"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y5_min"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y6_min"/></td>
                                    </tr>
                                    <tr>
                                        <th>Max. (raw, ie. not rounded)</th>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y1_max"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y2_max"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y3_max"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y4_max"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y5_max"/></td>
                                        <td><xsl:value-of select="data_birds_annexII/huntingbag_y6_max"/></td>
                                    </tr>
                                    <tr>
                                        <th>Unknown</th>
                                        <td><xsl:call-template name="getYesNoValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_y1_unknown"/></xsl:call-template></td>
                                        <td><xsl:call-template name="getYesNoValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_y2_unknown"/></xsl:call-template></td>
                                        <td><xsl:call-template name="getYesNoValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_y3_unknown"/></xsl:call-template></td>
                                        <td><xsl:call-template name="getYesNoValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_y4_unknown"/></xsl:call-template></td>
                                        <td><xsl:call-template name="getYesNoValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_y5_unknown"/></xsl:call-template></td>
                                        <td><xsl:call-template name="getYesNoValue"><xsl:with-param name="elem" select="data_birds_annexII/huntingbag_y6_unknown"/></xsl:call-template></td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <xsl:apply-templates select="data_birds_annexII/huntingbag_method"/>
                    <xsl:apply-templates select="data_birds_annexII/annexII_info"/>
                </tbody>
            </table>
        </xsl:if>

        <p class="report_end"> </p>
    </xsl:template>

    <xsl:template match="population_sources|population_info|population_trend_sources|population_trend_long_sources|population_trend_info|distribution_source|distribution_info|distribution_trend_source|distribution_trend_long_source|distribution_trend_info|measures_taken|further_info|measures_info|spa_info|annexII_info">
        <tr>
            <th>
                <xsl:call-template name="tag-label">
                    <xsl:with-param name="tagname" select="name(.)"/>
                </xsl:call-template>
            </th>
            <td class="preserve" colspan="2">
                <xsl:if test="string-length(.)!=0">
                    <xsl:call-template name="break">
                        <xsl:with-param name="text" select="."/>
                    </xsl:call-template>
                </xsl:if>
            </td>
        </tr>
    </xsl:template>

    <xsl:template match="pressures">
        <tr>
            <th>a) Pressure</th>
            <th>b) Ranking</th>
            <th>c) Location</th>
        </tr>
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="threats">
        <tr>
            <th>a) Threat</th>
            <th>b) Ranking</th>
            <th>c) Location</th>
        </tr>
        <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="pressure|threat">
        <tr>
            <td>
                <xsl:call-template name="getValue"><xsl:with-param name="elem" select="code"/></xsl:call-template>
            </td>
            <td>
                <xsl:call-template name="getValue"><xsl:with-param name="elem" select="ranking"/></xsl:call-template>
            </td>
            <td>
                <xsl:call-template name="getValue"><xsl:with-param name="elem" select="location"/></xsl:call-template>
            </td>
        </tr>
    </xsl:template>

    <xsl:template match="measure">
        <xsl:call-template name="getValue"><xsl:with-param name="elem" select="code"/></xsl:call-template>
        <br />
    </xsl:template>

</xsl:stylesheet>