View stylesheet

XML schema http://biodiversity.eionet.europa.eu/schemas/dir9243eec/gml_art17.xsd
Output type HTML
Description GML metadata factsheet
XSL file art17-gml.xsl (Last modified: 02 Feb 2007 16:08 )
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="lots/of/text" version="1.0" exclude-result-prefixes="xml" xmlns:gml="http://www.opengis.net/gml" xmlns:met="http://biodiversity.eionet.europa.eu/schemas/dir9243eec">
	<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:param name="envelopeurl"/>
<xsl:param name="envelopepath"/>

	<xsl:template match="gml:FeatureCollection">
		<html>
			<head>
				<title>Factsheet</title>
				<style type="text/css"><![CDATA[
img {
		border: 2px solid #ccc;
		margin: 10px;
}
h2 {
	font-family: arial, verdana, sans-serif;
}
h1 {
	font-size: 160%;
	padding-bottom: 0.5em;
	border-bottom: 1px solid #999999;
}
body {
		font-size: 80%;
		font-family: verdana, helvetica, arial, sans-serif;
		color: #333;
}
th {
		background-color:#f0f0f0;
		text-align:left;
		vertical-align: top;
		font-weight: normal;
		color: black;
}
table {
		font-size: 100%;
		border: 1px solid #bbb;
		width: 100%;
		margin: 0 0 2em 0;
}
table table {
		border: 0px solid #bbb;
		margin: 0;
}
th, td {
		font-size: 100%;
		border: 1px solid #bbb;
}
.has_table {
		border: 0px solid #bbb;
		padding: 0;
}
caption {
	text-align: left;
	padding: 0.4em 0;
	font-size: 120%;
	font-weight: bold;
}
th.tlabel {
	width: 300px;
}
.header_info {
	margin: 20px 0px;
	padding: 5px;
	font-size: 120%;
	border: 1px dashed #999999;
	background-color: #f0f0f0;
}
.header_info div {
	margin: 5px;
}
]]>
</style>
			</head>
			<body>
				<xsl:variable name="filename" select="gml:metaDataProperty/met:info/@href"/>
				<h1>Reporting of the GML metadata</h1>

				<!-- 'href' attribute on 'met:info' element must be implemented/generated in GML metadata in order to see the preview image -->
				<div class="header_info">
					<div>
						<span>File name:</span>
						<strong><xsl:value-of select="$filename" /></strong>
					</div>
					<div>
						<span>Map preview:</span>
						<div style="padding: 5px;">
						<img style="border: 1px solid #999999;" src="/Converters/convertDocument?file={$envelopepath}/{$filename}&amp;conv=loc_gmltopng_thumb"/>
						</div>
					</div>
				</div>
				<xsl:apply-templates select="gml:metaDataProperty/met:info/*"/>
			</body>
		</html>
	</xsl:template>

	<xsl:template match="met:mapOwner|met:mapNotes|met:copyrights|met:methodology|met:datasetsRetrievedFrom">
		<table border="1">
			<caption>
				<xsl:value-of select="@label" />
			</caption>
			<xsl:apply-templates select="*" />
		</table>
	</xsl:template>

	<xsl:template match="met:projection">
		<table border="1">
			<caption>
				<xsl:value-of select="@label" />
			</caption>
			<tr>
				<th class="tlabel">
					<xsl:value-of select="@label" />
				</th>
				<xsl:if test="string-length(.)=0">
					<td>
						N/A
					</td>
				</xsl:if>
				<xsl:if test="string-length(.)!=0">
					<td>
						<xsl:value-of select="substring(.,0,80)" /> ...
					</td>
				</xsl:if>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="*">
		<tr>
			<th class="tlabel">
				<xsl:value-of select="@label" />
			</th>
			<xsl:if test="string-length(.)=0">
				<td>
					N/A
				</td>
			</xsl:if>
			<xsl:if test="string-length(.)!=0">
				<td>
					<xsl:value-of select="." />
				</td>
			</xsl:if>
		</tr>
	</xsl:template>

</xsl:stylesheet>