View stylesheet

XML schemas http://cdrtest.eionet.eu.int/xmlexports/dir9243eec/schema.xsd
Output type HTML
Description Factsheet for web
XSL file habitats_factsheet.xsl (Last modified: 04 May 2006 15:15 )
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

 <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:preserve-space elements="source"/>

<xsl:template match="habitat">
	<html xml:lang="en">
		<head>
			<title>Factsheet</title>
                        <style type="text/css">
                        th { background-color:#87CEFA; text-align:left; }
                        table { border: 1px solid black; width: 100%; border-collapse: collapse;}
                        th, td { border: 1px solid black; }
                        </style>
		</head>
		<body>
			<h1>Factsheet</h1>
				<xsl:apply-templates select="national"/>
				<xsl:apply-templates select="regional"/>
		</body>
	</html>
</xsl:template>

<xsl:template match="national">
        <table>
        <caption>National level</caption>
            <xsl:apply-templates select="code"/>
            <xsl:apply-templates select="country"/>
            <xsl:apply-templates select="region"/>
            <xsl:apply-templates select="surface-range"/>
            <xsl:apply-templates select="map-range"/>
            <xsl:apply-templates select="map-favourable-range"/>
            <xsl:apply-templates select="distribution-area"/>
            <xsl:apply-templates select="map-distribution"/>
            <xsl:apply-templates select="map-favourable"/>
        </table>
</xsl:template>

<xsl:template match="regional">
        <table>
        <caption>Regional level</caption>
            <xsl:apply-templates select="region"/>
            <xsl:apply-templates select="source"/>
            <xsl:apply-templates select="range"/>
            <xsl:apply-templates select="coverage"/>
            <xsl:apply-templates select="complementary"/>
            <xsl:apply-templates select="conclusion"/>
        </table>
</xsl:template>

<xsl:template match="range|coverage|complementary|conclusion">
	<tr>
	<th scope="row">
		<xsl:value-of select="@label" />
        </th>
	<td>
	<table>
        <xsl:apply-templates/>
        </table>
	</td>
	</tr>
</xsl:template>
<xsl:template match="map">
  <img src="http://cdrtest.eionet.eu.int/images/at.jpg" width="559" height="381"/>
</xsl:template>

<xsl:template match="map-range|map-favourable-range|map-distribution|map-favourable">
	<tr>
	<th scope="row">
		<xsl:value-of select="@label" />
        </th>
	<td>
        <xsl:apply-templates/>
	</td>
	</tr>
</xsl:template>

<xsl:template match="*">
	<tr>
	<th scope="row">
		<xsl:value-of select="@label" />
        </th>
	<td>
		<xsl:value-of select="." />
	</td>
	</tr>
</xsl:template>

</xsl:stylesheet>