View stylesheet

XML schemas http://air-climate.eionet.europa.eu/schemas/AirQualityQuestionnaire/AirQualityQuestionnaire-form1.xsd
Output type HTML
Description HTML
XSL file form1.xslt (Last modified: 19 Feb 2009 16:34 )
<?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="form1">
		<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;
					}
					.vt-head {
						font-weight: bold;
                        width: auto;
                    }
                    .contact-info .vt-head {
                        width: 25em;
                    }

				</style>
			</head>
			<body>
				<h1><xsl:value-of select="$labels/tu[@tuid='lbl-form1-description']/tuv[@xml:lang=$lang]" /></h1>
				<h2><xsl:value-of select="$labels/tu[@tuid='lbl-group-contact-address']/tuv[@xml:lang=$lang]" /></h2>
                <h3><xsl:value-of select="$labels/tu[@tuid='lbl-contact-address']/tuv[@xml:lang=$lang]"/></h3>
                <p><xsl:value-of select="contact-address"/></p>

                <xsl:for-each select="contact-information">
                    <table class="contact-info"> <tbody>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-contact-body']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="contact-body-name"/></td> </tr>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-address']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="postal-address"/></td> </tr>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-contact-name']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="contact-person-name"/></td> </tr>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-contact-telephone']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="contact-person-telephone"/></td> </tr>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-contact-fax']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="contact-person-fax"/></td> </tr>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-contact-email']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="contact-person-email"/></td> </tr>
                            <tr> <td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-comments']/tuv[@xml:lang=$lang]" /></td> <td><xsl:value-of select="comments"/></td> </tr>
                    </tbody> </table>
                    <br />
                </xsl:for-each>

				<h2><xsl:value-of select="$labels/tu[@tuid='lbl-group-boundaries']/tuv[@xml:lang=$lang]" /></h2>
				<table> <tbody>
						<tr>
							<td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-zones-national-territory']/tuv[@xml:lang=$lang]" /></td>
							<td>
								<xsl:if test="zone-boundaries/zone-covers-national-territory = 'true'">yes</xsl:if>
								<xsl:if test="zone-boundaries/zone-covers-national-territory = 'false'">no</xsl:if>
							</td>
						</tr>
						<tr>
							<td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-zones-unchanged']/tuv[@xml:lang=$lang]" /></td>
							<td>
								<xsl:if test="zone-boundaries/are-zones-unchanged = 'true'">yes</xsl:if>
								<xsl:if test="zone-boundaries/are-zones-unchanged = 'false'">no</xsl:if>
							</td>
						</tr>
						<tr>
							<td class="vt-head"><xsl:value-of select="$labels/tu[@tuid='lbl-clarification']/tuv[@xml:lang=$lang]" /></td>
							<td><xsl:value-of select="zone-boundaries/clarification-comment"/></td>
						</tr>
				</tbody> </table>

				<h2><xsl:value-of select="$labels/tu[@tuid='lbl-group-revision']/tuv[@xml:lang=$lang]" /></h2>
				<table>
					<thead>
						<th><xsl:value-of select="$labels/tu[@tuid='lbl-revision-date']/tuv[@xml:lang=$lang]" /></th>
						<th><xsl:value-of select="$labels/tu[@tuid='lbl-updated-forms']/tuv[@xml:lang=$lang]" /></th>
						<th><xsl:value-of select="$labels/tu[@tuid='lbl-reason']/tuv[@xml:lang=$lang]" /></th>
					</thead>
					<tbody>
						<xsl:for-each select="revision-info/revision-row">
							<tr>
								<td><xsl:value-of select="revision-date"/></td>
								<td><xsl:value-of select="updated-forms"/></td>
								<td><xsl:value-of select="reason"/></td>
							</tr>
						</xsl:for-each>
					</tbody>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>