View stylesheet

XML schemas http://air-climate.eionet.europa.eu/schemas/AirQualityQuestionnaire/AirQualityQuestionnaire-form25.xsd
Output type HTML
Description HTML
XSL file form25.xslt (Last modified: 15 Apr 2009 17:25 )
<?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="form25">
	<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-form25']/tuv[@xml:lang=$lang]" />
				- <xsl:value-of select="$labels/tu[@tuid='lbl-form25-title']/tuv[@xml:lang=$lang]" />
			</h1>
			<h2>
				<xsl:value-of select="$labels/tu[@tuid='lbl-form25a-title']/tuv[@xml:lang=$lang]" />
			</h2>

			<xsl:value-of select="$labels/tu[@tuid='lbl-has-members-consulted-eachother']/tuv[@xml:lang=$lang]" />
			<strong style="padding-left: 10px; font-size: 1.2em;">
                <xsl:if test="form25a/has-consulted = 'true'">Yes</xsl:if>
                <xsl:if test="form25a/has-consulted = 'false'">No</xsl:if>
            </strong>
			

			<xsl:if test="form25a/has-consulted = 'true'">
				<h2>
					<xsl:value-of select="$labels/tu[@tuid='lbl-form25b-title']/tuv[@xml:lang=$lang]" />
				</h2>
				<table>
					<tr>
						<td>If yes, please:</td>
						<xsl:for-each select="form25b/country">
							<td><xsl:value-of select="code" /></td>
						</xsl:for-each>
					</tr>
					<tr>
						<td><xsl:value-of select="$labels/tu[@tuid='lbl-tick-country-concerned']/tuv[@xml:lang=$lang]" /></td>
						<xsl:for-each select="form25b/country">
							<td>
								<xsl:if test="concerned = 'true'">Yes</xsl:if>
								<xsl:if test="concerned = 'false'">No</xsl:if>
							</td>
						</xsl:for-each>
					</tr>
					<tr>
						<td><xsl:value-of select="$labels/tu[@tuid='lbl-tick-agenda-added']/tuv[@xml:lang=$lang]" /></td>
						<xsl:for-each select="form25b/country">
							<td>
								<xsl:if test="agenda = 'true'">Yes</xsl:if>
								<xsl:if test="agenda = 'false'">No</xsl:if>
							</td>
						</xsl:for-each>
					</tr>
					<tr>
						<td><xsl:value-of select="$labels/tu[@tuid='lbl-tick-minutes-added']/tuv[@xml:lang=$lang]" /></td>
						<xsl:for-each select="form25b/country">
							<td>
								<xsl:if test="minutes = 'true'">Yes</xsl:if>
								<xsl:if test="minutes = 'false'">No</xsl:if>
							</td>
						</xsl:for-each>
					</tr>
				</table>
			</xsl:if>
			<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 name="find-quantity">
	<xsl:param name="stationCode" />
	<xsl:param name="compoundName" />
	<xsl:param name="path" />
	<xsl:for-each select="$path">
		<xsl:variable name="i" select="." />
		<xsl:variable name="sc" select="eoi-station-code" />
		<xsl:if test="$stationCode = $sc">
			<xsl:for-each select="$i/compound">
				<xsl:variable name="cn" select="name" />
				<xsl:if test="$compoundName = $cn">
					<xsl:value-of select="./quantity" />
				</xsl:if>
			</xsl:for-each>
		</xsl:if>
	</xsl:for-each>
</xsl:template>


</xsl:stylesheet>