View stylesheet

XML schema http://air-climate.eionet.europa.eu/schemas/AirQualityQuestionnaire/AirQualityQuestionnaire-form21.xsd
Output type HTML
Description HTML
XSL file form21.xslt (Last modified: 15 Apr 2009 16:33 )
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<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="xml_folder_uri" />
	<xsl:variable name="lang">en</xsl:variable>

	<!-- Uncommment the lines below for production use -->
	<xsl:variable name="labels_xml" select="document(concat($xml_folder_uri,'aqq-labels.xml'))" />

	<!-- Uncomment the lines below for development use
	<xsl:variable name="labels_xml" select="document('../xml/aqq-labels.xml')" />
	-->

	<xsl:variable name="labels" select="$labels_xml/tmx/body" />
<xsl:template match="form21">
	<html>
		<head>
			<style type="text/css">
				table {
					border: 1px solid black;
					border-collapse: collapse;
					width: 100%;
				}
				table th {
					border: 1px solid black;
				}
				table td {
					border: 1px solid black;
				}
			</style>
		</head>
		<body>
			<h1>
				<xsl:value-of select="$labels/tu[@tuid='lbl-form21']/tuv[@xml:lang=$lang]" />
				- <xsl:value-of select="$labels/tu[@tuid='lbl-form21-title']/tuv[@xml:lang=$lang]" />
			</h1>
			<xsl:apply-templates select="form21a"/>
			<xsl:apply-templates select="form21b"/>
			<xsl:apply-templates select="form21c"/>
			<xsl:apply-templates select="form21d"/>
			<h2><xsl:value-of select="$labels/tu[@tuid='lbl-form-comments']/tuv[@xml:lang=$lang]" /></h2>
			<p><xsl:value-of select="form-comments"/></p>
		</body>
	</html>
</xsl:template>

<xsl:template match="form21a">
	<h2><xsl:value-of select="$labels/tu[@tuid='lbl-form21a-title']/tuv[@xml:lang=$lang]" /></h2>
	<table>
		<thead>
			<tr>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-zone']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-station-code']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-exceedence-measured']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-natural-sources']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-estimated-exceedence']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-reference-justification']/tuv[@xml:lang=$lang]" /></th>
			</tr>
		</thead>
		<tbody>
			<xsl:for-each select="form21a-row">
				<tr>
					<td><xsl:value-of select="zone-code"/></td>
					<td><xsl:value-of select="eoi-station-code"/></td>
					<td><xsl:value-of select="exceedences-number"/></td>
					<td><xsl:value-of select="natural-source-code"/></td>
					<td><xsl:value-of select="estimated-exceedences"/></td>
					<td><xsl:value-of select="reference-to-justification"/></td>
				</tr>
			</xsl:for-each>
		</tbody>
	</table>
</xsl:template>
<xsl:template match="form21b">
	<h2><xsl:value-of select="$labels/tu[@tuid='lbl-form21b-title']/tuv[@xml:lang=$lang]" /></h2>
	<table>
		<thead>
			<tr>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-zone']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-station-code']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-exceedence-measured']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-natural-sources']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-estimated-exceedence']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-reference-justification']/tuv[@xml:lang=$lang]" /></th>
			</tr>
		</thead>
		<tbody>
			<xsl:for-each select="form21b-row">
				<tr>
					<td><xsl:value-of select="zone-code"/></td>
					<td><xsl:value-of select="eoi-station-code"/></td>
					<td><xsl:value-of select="exceedences-number"/></td>
					<td><xsl:value-of select="natural-source-code"/></td>
					<td><xsl:value-of select="estimated-exceedences"/></td>
					<td><xsl:value-of select="reference-to-justification"/></td>
				</tr>
			</xsl:for-each>
		</tbody>
	</table>
</xsl:template>
<xsl:template match="form21c">
	<h2><xsl:value-of select="$labels/tu[@tuid='lbl-form21c-title']/tuv[@xml:lang=$lang]" /></h2>
	<table>
		<thead>
			<tr>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-zone']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-station-code']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-anual-concentration']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-natural-sources']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-estimated-anual-exceedence']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-reference-justification']/tuv[@xml:lang=$lang]" /></th>
			</tr>
		</thead>
		<tbody>
			<xsl:for-each select="form21c-row">
				<tr>
					<td><xsl:value-of select="zone-code"/></td>
					<td><xsl:value-of select="eoi-station-code"/></td>
					<td><xsl:value-of select="mean-concentration-y"/></td>
					<td><xsl:value-of select="natural-source-code"/></td>
					<td><xsl:value-of select="estimated-mean-concentration"/></td>
					<td><xsl:value-of select="reference-to-justification"/></td>
				</tr>
			</xsl:for-each>
		</tbody>
	</table>
</xsl:template>
<xsl:template match="form21d">
	<h2><xsl:value-of select="$labels/tu[@tuid='lbl-form21d-title']/tuv[@xml:lang=$lang]" /></h2>
	<table>
		<thead>
			<tr>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-zone']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-station-code']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-winter-exceedence']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-natural-sources']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-estimated-anual-exceedence']/tuv[@xml:lang=$lang]" /></th>
				<th><xsl:value-of select="$labels/tu[@tuid='lbl-reference-justification']/tuv[@xml:lang=$lang]" /></th>
			</tr>
		</thead>
		<tbody>
			<xsl:for-each select="form21d-row">
				<tr>
					<td><xsl:value-of select="zone-code"/></td>
					<td><xsl:value-of select="eoi-station-code"/></td>
					<td><xsl:value-of select="mean-concentration-w"/></td>
					<td><xsl:value-of select="natural-source-code"/></td>
					<td><xsl:value-of select="estimated-mean-concentration"/></td>
					<td><xsl:value-of select="reference-to-justification"/></td>
				</tr>
			</xsl:for-each>
		</tbody>
	</table>
</xsl:template>
</xsl:stylesheet>