View stylesheet

XML schemas http://waste.eionet.eu.int/schemas/dir200053ec/schema.xsd
Output type EXCEL
Description MS-Excel output for only the numeric data (q2.3, q2.4, q2.5, q2.8)
XSL file elv_excel_1.xsl (Last modified: 28 Feb 2006 10:37 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:office='http://openoffice.org/2000/office' 	xmlns:table='http://openoffice.org/2000/table' xmlns:text='http://openoffice.org/2000/text'
>

<xsl:template match="questionnaire">
<office:document-content xmlns:office='http://openoffice.org/2000/office' xmlns:table='http://openoffice.org/2000/table' office:version='1.0' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:number='http://openoffice.org/2000/datastyle' xmlns:text='http://openoffice.org/2000/text' xmlns:fo='http://www.w3.org/1999/XSL/Format' xmlns:style='http://openoffice.org/2000/style'>
	<office:automatic-styles>
		<style:style style:name='cell1' style:family='table-cell' >
			<style:properties fo:text-align='right' fo:font-size='10pt'/>
		</style:style>
		<style:style style:name='cell2' style:family='table-cell' >
			<style:properties fo:text-align='left' fo:font-size='10pt' fo:font-style='italic'/>
		</style:style>
		<style:style style:name='Heading1' style:family='table-cell' >
			<style:properties fo:text-align='left' fo:font-size='10pt' fo:font-style='italic' style:text-align-source='fix' fo:font-weight='bold'/>
		</style:style>
		<style:style style:name='Heading2' style:family='table-cell' >
			<style:properties fo:text-align='right' fo:font-size='10pt' fo:font-weight='bold' />
		</style:style>
		<style:style style:name='Heading3' style:family='table-cell' >
			<style:properties fo:text-align='right' fo:font-size='10pt' fo:font-weight='bold' />
		</style:style>

	</office:automatic-styles>
	<office:body>
		<table:table>
			<xsl:attribute name="table:name">Questionnaire</xsl:attribute>
			<table:table-columns>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell1'>
					<xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="4"/></xsl:attribute>
				</table:table-column>
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<xsl:apply-templates select="q2-3"/>
				<xsl:apply-templates select="q2-4"/>
				<xsl:apply-templates select="q2-5"/>
				<xsl:apply-templates select="q2-8"/>
			</table:table-rows>
		</table:table>
	</office:body>
</office:document-content>
</xsl:template>

<xsl:template match="q2-3">
				<xsl:call-template name="questionTable">
					<xsl:with-param name="q_label">2.3. Please indicate the number of vehicles collected and transferred to authorised treatment facilities in each calendar year of the reference period.</xsl:with-param>
				</xsl:call-template>
</xsl:template>

<xsl:template match="q2-4">
				<xsl:call-template name="questionTable">
					<xsl:with-param name="q_label">2.4. Please indicate the number of vehicles collected and transferred to authorised treatment facilities in each calendar year of the reference period.</xsl:with-param>
				</xsl:call-template>
</xsl:template>

<xsl:template match="q2-5">
				<xsl:call-template name="questionTable">
					<xsl:with-param name="q_label">2.5. Please indicate the number of end-of-life vehicles delivered at authorised treatment facilities and having no or a negative market value. Please provide details on the average negative value of these end-of-life vehicles.</xsl:with-param>
				</xsl:call-template>
</xsl:template>

<xsl:template match="q2-8">
				<xsl:call-template name="questionTable">
					<xsl:with-param name="q_label">2.8. Please provide information on the rates of reuse, recycling and recovery attained in each calendar year of the reference period, in pursuance of the objectives laid down in Article 7(2).</xsl:with-param>
				</xsl:call-template>
</xsl:template>

<xsl:template name="questionTable">
	<xsl:param name="q_label"/>
		<xsl:if test="position()=1">
			<table:table-header-rows>
				<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading1' >
					<table:table-cell>
						<text:p><xsl:value-of select="$q_label"/></text:p>
					</table:table-cell>
				</table:table-row>
				<xsl:call-template name="header"/>
			</table:table-header-rows>
	</xsl:if>
	<xsl:apply-templates select="value" />
	<xsl:call-template name="comment"/>
</xsl:template>

<xsl:template match="value">
	<table:table-row>
		<table:table-cell table:default-cell-style-name='Heading3' >
			<text:p><xsl:value-of select="@label" /></text:p>
		</table:table-cell>
		<xsl:apply-templates select="collected"/>
	</table:table-row>
</xsl:template>


<!--   template for building table cells with values -->

<xsl:template match="collected">
	<table:table-cell  table:default-cell-value-type='number'>
		<text:p><xsl:value-of select="." /></text:p>
	</table:table-cell>
</xsl:template>

<!--  a named template, which creates the table header row -->
<xsl:template name="header">
		<table:table-row  table:default-cell-value-type='number' table:default-cell-style-name='Heading2' >
				<table:table-cell><text:p/></table:table-cell>
			<xsl:for-each select="value[1]/collected">
				<table:table-cell>
					<text:p><xsl:value-of select="@label" /></text:p>
				</table:table-cell>
			</xsl:for-each>
		</table:table-row>
</xsl:template>

<xsl:template name="comment">
	<xsl:for-each select="./*">
		<xsl:if test="local-name()=concat(local-name(..), 'c')">
		<table:table-row table:default-cell-style-name='cell2' >
				<table:table-cell>
					<text:p><xsl:value-of select="." /></text:p>
				</table:table-cell>
		</table:table-row>
		<table:table-row>
				<table:table-cell><text:p/></table:table-cell>
		</table:table-row>
		<table:table-row>
				<table:table-cell><text:p/></table:table-cell>
		</table:table-row>
		</xsl:if>
	</xsl:for-each>
</xsl:template>
</xsl:stylesheet>