View stylesheet

XML schemas http://www.eionet.europa.eu/schemas/dir200442ec/schema200442.xsd
Output type EXCEL
Description MS Excel spreadsheet
XSL file dir200442_excel.xsl (Last modified: 10 Jun 2011 13:19 )
<?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'>
	<!-- quizás sobre esto -->
	<xsl:output method="xml" indent="yes"/>
	<xsl:param name="envelopeurl"/>
	<!-- quizás sobre esto -->
	<xsl:param name="xml_folder_uri"/>
	<xsl:variable name="language">en</xsl:variable>
	<!--PRODUCCION --> 
	<xsl:variable name="labels_doc" select="document(concat($xml_folder_uri,'dir200442_labels.xml'))/labels"/>
	<!-- LOCAL 
	<xsl:variable name="labels_doc" select="document('dir200442_labels.xml')/labels"/>
	-->
	<xsl:variable name="labels" select="$labels_doc/itemset[@id='200442' and @xml:lang=$language]"/>

	<xsl:template match="response">

		<office:document-content xmlns:office='urn:oasis:names:tc:opendocument:xmlns:office:1.0' xmlns:table='urn:oasis:names:tc:opendocument:xmlns:table:1.0' office:version='1.0' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:number='urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0' xmlns:text='urn:oasis:names:tc:opendocument:xmlns:text:1.0' xmlns:fo='urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0' xmlns:style='urn:oasis:names:tc:opendocument:xmlns:style:1.0'>
			<office:automatic-styles>
				<style:style style:name='cell1' style:family='table-cell'>
					<style:properties fo:text-align='justify' fo:font-size='10pt' style:column-width="20cm"/>
					<style:text-properties fo:font-size='10pt'/>
					<style:paragraph-properties fo:text-align="justify"/>
				</style:style>
				<style:style style:name='cell2' style:family='table-cell'>
					<style:properties fo:text-align='justify' fo:font-size='10pt' style:column-width="4cm"/>
					<style:text-properties fo:font-size='10pt'/>
					<style:paragraph-properties fo:text-align="justify"/>
				</style:style>
				<style:style style:name='cell3' style:family='table-cell'>
					<style:properties fo:text-align='justify' fo:font-size='10pt' style:column-width="8cm"/>
					<style:text-properties fo:font-size='10pt'/>
					<style:paragraph-properties fo:text-align="justify"/>
				</style:style>
				<style:style style:name='Heading1' style:family="table-cell" style:parent-style-name="Default">
					<style:text-properties fo:text-align='left' fo:font-size='12pt' fo:font-style='italic' style:text-align-source='fix' fo:font-weight='bold'/>
					<style:properties fo:text-align='left' fo:font-size='12pt' 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:text-properties fo:text-align='auto' fo:font-size='11pt' fo:font-weight='bold'/>
					<style:properties fo:text-align='auto' fo:font-size='11pt' fo:font-weight='bold'/>
				</style:style>
				<style:style style:name='Heading3' style:family='table-cell'>
					<style:properties fo:text-align='justify' fo:font-size='10pt' fo:font-weight='bold' fo:font-style="italic"/>
					<style:text-properties fo:font-size='10pt' fo:font-weight='bold' fo:font-style="italic"/>
					<style:paragraph-properties fo:text-align="justify"/>
				</style:style>
				<style:style style:name='Heading4' style:family='table-cell'>
					<style:text-properties fo:text-align='right' fo:font-size='10pt' fo:font-weight='bold' fo:font-style="italic"/>
					<style:properties fo:text-align='right' fo:font-size='10pt' fo:font-weight='bold' fo:font-style="italic"/>
					<style:paragraph-properties fo:text-align="justify"/>
				</style:style>
				<style:style style:name="co1" style:family="table-column">
					<style:table-column-properties fo:break-before="auto" style:column-width="30cm"/>
				</style:style>
				<style:style style:name="co2" style:family="table-column">
					<style:table-column-properties fo:break-before="auto" style:column-width="10cm"/>
				</style:style>
				<style:style style:name="co3" style:family="table-column">
					<style:table-column-properties fo:break-before="auto" style:column-width="4cm"/>
				</style:style>
				<style:style style:name="co4" style:family="table-column">
					<style:table-column-properties fo:break-before="auto" style:column-width="8cm"/>
				</style:style>
			</office:automatic-styles>
			<office:body>
				<office:spreadsheet>

					<table:table>
						<xsl:attribute name="table:name">Questionnaire</xsl:attribute>
						<table:table-columns>
							<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co1"/>
							<table:table-column table:style-name="co2" table:default-cell-style-name="cell1"/>
						</table:table-columns>

						<!-- create header rows -->
						<table:table-rows>
							<table:table-header-rows>
								<table:table-row>
									<table:table-cell>
										<text:p/>
									</table:table-cell>
									<table:table-cell>
										<text:p/>
									</table:table-cell>
								</table:table-row>
								<table:table-row>
									<table:table-cell table:style-name="Heading1">
										<text:p>
											<xsl:value-of select="$labels/item[@id='h1']"/>
										</text:p>
									</table:table-cell>
								</table:table-row>
								<table:table-row>
									<table:table-cell>
										<text:p/>
									</table:table-cell>
								</table:table-row>
							</table:table-header-rows>

							<xsl:call-template name="metadata"/>

							<xsl:call-template name="emptyRow"/>

							<xsl:call-template name="buildHeading2">
								<xsl:with-param name="heading">
									<xsl:value-of select="translate($labels/item[@id='q-1'],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
								</xsl:with-param>
							</xsl:call-template>

							<xsl:call-template name="emptyRow"/>

							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-1-1']"/>
								</xsl:with-param>
							</xsl:call-template>

							<xsl:apply-templates select="q-1/q-1-1/q-1-1-a | q-1/q-1-1/q-1-1-b | q-1/q-1-1/q-1-1-c | q-1/q-1-1/q-1-1-d | q-1/q-1-1/q-1-1-e"/>
								
							<xsl:call-template name="emptyRow"/>

							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-1-2']"/>
								</xsl:with-param>
							</xsl:call-template>

							<xsl:apply-templates select="q-1/q-1-2/q-1-2-a | q-1/q-1-2/q-1-2-b | q-1/q-1-2/q-1-2-c"/>
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:apply-templates select="q-1/q-1-3"/>
							
							<xsl:call-template name="emptyRow"/>
							<xsl:call-template name="emptyRow"/>
							
							<xsl:call-template name="buildHeading2">
								<xsl:with-param name="heading">
									<xsl:value-of select="translate($labels/item[@id='q-2'],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
								</xsl:with-param>
							</xsl:call-template>							
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:apply-templates select="q-2/q-2-1/q-2-1-a | q-2/q-2-1/q-2-1-b | q-2/q-2-1/q-2-1-c"/>
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-2']"/>
								</xsl:with-param>
							</xsl:call-template>							
							
							<xsl:apply-templates select="q-2/q-2-2/q-2-2-a | q-2/q-2-2/q-2-2-b | q-2/q-2-2/q-2-2-c | q-2/q-2-2/q-2-2-d"/>
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-3']"/>
								</xsl:with-param>
							</xsl:call-template>														
							
							<xsl:apply-templates select="q-2/q-2-3/q-2-3-a | q-2/q-2-3/q-2-3-b | q-2/q-2-3/q-2-3-c | q-2/q-2-3/q-2-3-d | q-2/q-2-3/q-2-3-e"/>
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-4']"/>
								</xsl:with-param>
							</xsl:call-template>															

							<xsl:apply-templates select="q-2/q-2-4"/>
									
							<xsl:call-template name="emptyRow"/>
														
							<xsl:apply-templates select="q-2/q-2-5"/>														
							
							<xsl:call-template name="emptyRow"/>

							<xsl:apply-templates select="q-2/q-2-6"/>							
							
							<xsl:call-template name="emptyRow"/>

							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-7']"/>
								</xsl:with-param>
							</xsl:call-template>															

							<xsl:apply-templates select="q-2/q-2-7"/>
							
							<xsl:call-template name="emptyRow"/>							
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-8']"/>
								</xsl:with-param>
							</xsl:call-template>															

							<xsl:apply-templates select="q-2/q-2-8"/>							
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-9']"/>
								</xsl:with-param>
							</xsl:call-template>															

							<xsl:apply-templates select="q-2/q-2-9"/>		
							
							<xsl:call-template name="emptyRow"/>					
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-2-10']"/>
								</xsl:with-param>
							</xsl:call-template>															

							<xsl:apply-templates select="q-2/q-2-10"/>	
							
							<xsl:call-template name="emptyRow"/>																																		

							<xsl:apply-templates select="q-2/q-2-11"/>		
							
							<xsl:call-template name="emptyRow"/>
							<xsl:call-template name="emptyRow"/>					
																				
							<xsl:call-template name="buildHeading2">
								<xsl:with-param name="heading">
									<xsl:value-of select="translate($labels/item[@id='q-3'],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
								</xsl:with-param>
							</xsl:call-template>

							<xsl:call-template name="emptyRow"/>
												
							<xsl:apply-templates select="q-3/q-3-1"/>		

							<xsl:call-template name="emptyRow"/>
												
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-1-1']"/>
								</xsl:with-param>
							</xsl:call-template>												
							<xsl:call-template name="buildHeading3Table">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-1-1-p1']"/>
								</xsl:with-param>
								<xsl:with-param name="message">
									<xsl:text>See "3.1.1 Table A" sheet</xsl:text>
								</xsl:with-param>
							</xsl:call-template>			
							
							<xsl:call-template name="emptyRow"/>
												
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-1-2']"/>
								</xsl:with-param>
							</xsl:call-template>												
							<xsl:call-template name="buildHeading3Table">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-1-2-p1']"/>
								</xsl:with-param>
								<xsl:with-param name="message">
									<xsl:text>See "3.1.2 Table B" sheet</xsl:text>
								</xsl:with-param>								
							</xsl:call-template>			
							
							<xsl:call-template name="emptyRow"/>
												
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-1-3']"/>
								</xsl:with-param>
							</xsl:call-template>												
							<xsl:call-template name="buildHeading3Table">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-1-3-p1']"/>
								</xsl:with-param>
								<xsl:with-param name="message">
									<xsl:text>See "3.1.3 Table C" sheet</xsl:text>
								</xsl:with-param>															
							</xsl:call-template>			
							
							<xsl:call-template name="emptyRow"/>
												
							<xsl:call-template name="buildHeading3Table">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-2']"/>
								</xsl:with-param>
								<xsl:with-param name="message">
									<xsl:text>See "3.2 Table" sheet</xsl:text>
								</xsl:with-param>															
							</xsl:call-template>												
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-2-p1']"/>
								</xsl:with-param>
							</xsl:call-template>			
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-3-2-p2']"/>
								</xsl:with-param>
							</xsl:call-template>							
							
							<xsl:call-template name="emptyRow"/>
												
							<xsl:apply-templates select="q-3/q-3-3"/>																																					
																				
							<xsl:call-template name="emptyRow"/>
							<xsl:call-template name="emptyRow"/>					
																				
							<xsl:call-template name="buildHeading2">
								<xsl:with-param name="heading">
									<xsl:value-of select="translate($labels/item[@id='q-4'],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
								</xsl:with-param>
							</xsl:call-template>
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:apply-templates select="q-4/q-4-1"/>																														
							
							<xsl:call-template name="emptyRow"/>							
							
							<xsl:apply-templates select="q-4/q-4-2"/>																														
							
							<xsl:call-template name="emptyRow"/>														
							
							<xsl:call-template name="buildHeading3Table">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-4-3']"/>
								</xsl:with-param>
								<xsl:with-param name="message">
									<xsl:text>See "4.3 Table" sheet</xsl:text>
								</xsl:with-param>															
							</xsl:call-template>			
							
							<xsl:call-template name="emptyRow"/>
							<xsl:call-template name="emptyRow"/>					
																				
							<xsl:call-template name="buildHeading2">
								<xsl:with-param name="heading">
									<xsl:value-of select="translate($labels/item[@id='q-5'],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
								</xsl:with-param>
							</xsl:call-template>
							
							<xsl:call-template name="emptyRow"/>		
							
							<xsl:apply-templates select="q-5/q-5-1"/>																														
							
							<xsl:call-template name="emptyRow"/>																															
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-5-2']"/>
								</xsl:with-param>
							</xsl:call-template>														
							
							<xsl:apply-templates select="q-5/q-5-2/q-5-2-a | q-5/q-5-2/q-5-2-b | q-5/q-5-2/q-5-2-c"/>
							
							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-5-2-d']"/>
								</xsl:with-param>
							</xsl:call-template>								
							
							<xsl:apply-templates select="q-5/q-5-2/q-5-2-d/q-5-2-d-a | q-5/q-5-2/q-5-2-d/q-5-2-d-b"/>

							<xsl:call-template name="buildHeading3">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-5-2-e']"/>
								</xsl:with-param>
							</xsl:call-template>								
							
							<xsl:apply-templates select="q-5/q-5-2/q-5-2-e/q-5-2-e-a | q-5/q-5-2/q-5-2-e/q-5-2-e-b"/>

							<xsl:call-template name="buildHeading3Table">
								<xsl:with-param name="heading">
									<xsl:value-of select="$labels/item[@id='q-5-2-f']"/>
								</xsl:with-param>
								<xsl:with-param name="message">
									<xsl:text>See "5.2.f Table" sheet</xsl:text>
								</xsl:with-param>															
							</xsl:call-template>								

							<xsl:call-template name="emptyRow"/>
							<xsl:call-template name="emptyRow"/>					
																				
							<xsl:call-template name="buildHeading2">
								<xsl:with-param name="heading">
									<xsl:value-of select="translate($labels/item[@id='q-6'],'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
								</xsl:with-param>
							</xsl:call-template>
							
							<xsl:call-template name="emptyRow"/>
							
							<xsl:apply-templates select="q-6/q-6-1/q-6-1-a | q-6/q-6-1/q-6-1-b"/>
							
							<xsl:call-template name="emptyRow"/>							
							
							<xsl:apply-templates select="q-6/q-6-2"/>							
																				
						</table:table-rows>
					</table:table>
					
					<xsl:apply-templates select="q-3/q-3-1-table1"/>

					<xsl:apply-templates select="q-3/q-3-1-table2"/>					
					
					<xsl:apply-templates select="q-3/q-3-1-table3"/>										

					<xsl:apply-templates select="q-3/q-3-2-table"/>															
					
					<xsl:apply-templates select="q-4/q-4-3-table"/>										
					
					<xsl:apply-templates select="q-5/q-5-2/q-5-2-f-table"/>															
					
				</office:spreadsheet>
			</office:body>
		</office:document-content>

	</xsl:template>
	
	<xsl:template match="*">
		<xsl:variable  name="elem-name" select="local-name(.)"/>

		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
				<xsl:value-of select="$labels/item[@id=$elem-name]"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildAnswer">
				<xsl:with-param name="answer"><xsl:value-of select="."/></xsl:with-param>
				<xsl:with-param name="yesno"><xsl:value-of select="$elem-name='q-2-1-a' or $elem-name='q-2-1-b' or $elem-name='q-5-1'"/></xsl:with-param>
				<xsl:with-param name="checkbox"><xsl:value-of select="$elem-name='q-2-4-a' or $elem-name='q-2-4-b' or $elem-name='q-2-4-c' or $elem-name='q-2-4-d' or $elem-name='q-2-7-a' or $elem-name='q-2-7-b' or $elem-name='q-2-8-a' or $elem-name='q-2-8-b' or $elem-name='q-2-9-a' or $elem-name='q-2-9-b' or $elem-name='q-2-10-a' or $elem-name='q-2-10-b' or $elem-name='q-2-10-c' or $elem-name='q-2-10-d'"/></xsl:with-param>
			</xsl:call-template>
		</table:table-row>			
	</xsl:template>	
	
	<xsl:template match="q-2-4">
		<xsl:apply-templates select="q-2-4-a | q-2-4-b | q-2-4-c | q-2-4-d"/>	
		
		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-2-4-e']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildLiteralAnswer">
				<xsl:with-param name="answer">
					<xsl:value-of select="q-2-4-e-comments"/>
				</xsl:with-param>	
			</xsl:call-template>
		</table:table-row>
	</xsl:template>		

	<xsl:template match="q-2-5">		
		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-2-5']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildLiteralAnswer">
				<xsl:with-param name="answer">
					<xsl:value-of select="concat(q-2-5-quantity,' ',q-2-5-units)"/>
				</xsl:with-param>	
			</xsl:call-template>
		</table:table-row>
	</xsl:template>		
	
	<xsl:template match="q-2-7">
		<xsl:apply-templates select="q-2-7-a | q-2-7-b"/>	
		
		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-2-7-c']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildLiteralAnswer">
				<xsl:with-param name="answer">
					<xsl:value-of select="q-2-7-c-comments"/>
				</xsl:with-param>	
			</xsl:call-template>
		</table:table-row>
	</xsl:template>			
	
	<xsl:template match="q-2-8">
		<xsl:apply-templates select="q-2-8-a | q-2-8-b"/>	
		
		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-2-8-c']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildLiteralAnswer">
				<xsl:with-param name="answer">
					<xsl:value-of select="q-2-8-c-comments"/>
				</xsl:with-param>	
			</xsl:call-template>
		</table:table-row>
	</xsl:template>				
	
	<xsl:template match="q-2-9">
		<xsl:apply-templates select="q-2-9-a | q-2-9-b"/>	
		
		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-2-9-c']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildLiteralAnswer">
				<xsl:with-param name="answer">
					<xsl:value-of select="q-2-9-c-comments"/>
				</xsl:with-param>	
			</xsl:call-template>
		</table:table-row>
	</xsl:template>			
	
	<xsl:template match="q-2-10">
		<xsl:apply-templates select="q-2-10-a | q-2-10-b | q-2-10-c | q-2-10-d"/>	
		
		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-2-10-e']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildLiteralAnswer">
				<xsl:with-param name="answer">
					<xsl:value-of select="q-2-10-e-comments"/>
				</xsl:with-param>	
			</xsl:call-template>
		</table:table-row>
	</xsl:template>					
	
	<xsl:template match="q-3-1">

		<xsl:call-template name="buildHeading3">
			<xsl:with-param name="heading">
				<xsl:value-of select="$labels/item[@id='q-3-1']"/>
			</xsl:with-param>
		</xsl:call-template>												
		<xsl:call-template name="buildHeading3">
			<xsl:with-param name="heading">
				<xsl:value-of select="$labels/item[@id='q-3-1-p1']"/>
			</xsl:with-param>
		</xsl:call-template>								
		<xsl:call-template name="buildHeading3">
			<xsl:with-param name="heading">
				<xsl:value-of select="$labels/item[@id='q-3-1-p2']"/>
			</xsl:with-param>
		</xsl:call-template>								

		<table:table-row>
			<xsl:call-template name="buildQuestion">
				<xsl:with-param name="q">
					<xsl:value-of select="$labels/item[@id='q-3-1-p3']"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="buildAnswer">
				<xsl:with-param name="answer"><xsl:value-of select="."/></xsl:with-param>
			</xsl:call-template>
		</table:table-row>										

	</xsl:template>
	
	<xsl:template match="q-3-1-table1">

		<table:table table:name="3.1.1 Table A">
			<table:table-columns>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>				
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<table:table-header-rows>
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>						
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-1']"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-p1']"/></text:p>
						</table:table-cell>
					</table:table-row>

					<xsl:call-template name="emptyRow"/>
					<xsl:call-template name="emptyRow"/>					
					
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-head1']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-head2']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-head3']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-head4']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-head5']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-head6']"/></text:p></table:table-cell>
					</table:table-row>
				</table:table-header-rows>
				<xsl:apply-templates select="q-3-1-table1-row1 | q-3-1-table1-row2 | q-3-1-table1-row3"/>
			</table:table-rows>
		</table:table>
	
	</xsl:template>
	
	<xsl:template match="q-3-1-table1-row1">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-row1']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row1-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row1-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row1-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row1-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row1-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>
	
	<xsl:template match="q-3-1-table1-row2">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-row2']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row2-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row2-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row2-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row2-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row2-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>	
	
	<xsl:template match="q-3-1-table1-row3">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-1-row3']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row3-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row3-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row3-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row3-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table1-row3-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>		
	
	<xsl:template match="q-3-1-table2">

		<table:table table:name="3.1.2 Table B">
			<table:table-columns>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>				
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<table:table-header-rows>
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>						
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-2']"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-p1']"/></text:p>
						</table:table-cell>
					</table:table-row>

					<xsl:call-template name="emptyRow"/>
					<xsl:call-template name="emptyRow"/>					
					
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-head1']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-head2']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-head3']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-head4']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-head5']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-head6']"/></text:p></table:table-cell>
					</table:table-row>
				</table:table-header-rows>

				<xsl:apply-templates select="q-3-1-table2-row1 | q-3-1-table2-row2 | q-3-1-table2-row3 | q-3-1-table2-row4"/>
				
				<xsl:call-template name="emptyRow"/>
				<xsl:call-template name="emptyRow"/>
				
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-row5']"/></text:p>
						</table:table-cell>
					</table:table-row>				
				
			</table:table-rows>
		</table:table>
	
	</xsl:template>	
	
	<xsl:template match="q-3-1-table2-row1">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-row1']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row1-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row1-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row1-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row1-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row1-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>	
	
	<xsl:template match="q-3-1-table2-row2">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-row2']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row2-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row2-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row2-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row2-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row2-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>	
	
	<xsl:template match="q-3-1-table2-row3">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-row3']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row3-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row3-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row3-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row3-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row3-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>		
	
	<xsl:template match="q-3-1-table2-row4">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-2-row4']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row4-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row4-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row4-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row4-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table2-row4-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>			
	
	<xsl:template match="q-3-1-table3">

		<table:table table:name="3.1.3 Table C">
			<table:table-columns>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>				
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<table:table-header-rows>
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>						
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-3']"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-p1']"/></text:p>
						</table:table-cell>
					</table:table-row>

					<xsl:call-template name="emptyRow"/>
					<xsl:call-template name="emptyRow"/>					
					
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-head1']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-head2']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-head3']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-head4']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-head5']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-head6']"/></text:p></table:table-cell>
					</table:table-row>
				</table:table-header-rows>

				<xsl:apply-templates select="q-3-1-table3-row1 | q-3-1-table3-row2 | q-3-1-table3-row3"/>
									
				
			</table:table-rows>
		</table:table>	
	
	</xsl:template>		
	
	
	<xsl:template match="q-3-1-table3-row1">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-row1']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row1-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row1-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row1-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row1-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row1-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>
	
	<xsl:template match="q-3-1-table3-row2">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-row2']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row2-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row2-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row2-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row2-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row2-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>	
	
	<xsl:template match="q-3-1-table3-row3">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-1-3-row3']"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row3-Manufacturers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row3-Importers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row3-Wholesalers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row3-Retailers"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-1-table3-row3-Others"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>		
	
	
	<xsl:template match="q-3-2-table">

		<table:table table:name="3.2 Table">
			<table:table-columns>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<table:table-header-rows>
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>						
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-2']"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-2-p1']"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-3-2-p2']"/></text:p>
						</table:table-cell>
					</table:table-row>					

					<xsl:call-template name="emptyRow"/>
					<xsl:call-template name="emptyRow"/>					
					
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell table:style-name="Heading3"><text:p/></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-2-head1']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-3-2-head2']"/></text:p></table:table-cell>
					</table:table-row>
				</table:table-header-rows>

				<xsl:apply-templates select="q-3-2-table-row1 | q-3-2-table-row2 | q-3-2-table-row3 | q-3-2-table-row4 | q-3-2-table-row5"/>			
				
			</table:table-rows>
		</table:table>	
	
	</xsl:template>			

	<xsl:template match="q-3-2-table-row1">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:text>1</xsl:text></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row1-col1"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row1-col2"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>		
	
	<xsl:template match="q-3-2-table-row2">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:text>2</xsl:text></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row2-col1"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row2-col2"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>			
	
	<xsl:template match="q-3-2-table-row3">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:text>3</xsl:text></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row3-col1"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row3-col2"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>				
	
	<xsl:template match="q-3-2-table-row4">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:text>4</xsl:text></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row4-col1"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row4-col2"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>					
	
	<xsl:template match="q-3-2-table-row5">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell table:style-name="Heading3"><text:p><xsl:text>5</xsl:text></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row5-col1"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-3-2-table-row5-col2"/></text:p></table:table-cell>
		</table:table-row>
	</xsl:template>						
	
	<xsl:template match="q-4-3-table">

		<table:table table:name="4.3 Table">
			<table:table-columns>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell3' table:style-name="co4"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell3' table:style-name="co4"/>				
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<table:table-header-rows>
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>						
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-4-3']"/></text:p>
						</table:table-cell>
					</table:table-row>

					<xsl:call-template name="emptyRow"/>
					<xsl:call-template name="emptyRow"/>					
					
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-4-3-head1']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-4-3-head2']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-4-3-head3']"/></text:p></table:table-cell>
					</table:table-row>
				</table:table-header-rows>

				<xsl:apply-templates/>
									
				
			</table:table-rows>
		</table:table>	
	
	</xsl:template>			
	
	<xsl:template match="q-4-3-table-row">

		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell><text:p><xsl:value-of select="q-4-3-table-row-categ"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-4-3-table-row-quant"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-4-3-table-row-units"/></text:p></table:table-cell>
		</table:table-row>

	</xsl:template>
	
	
	<xsl:template match="q-5-2-f-table">

		<table:table table:name="5.2.f Table">
			<table:table-columns>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell1' table:style-name="co2"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell3' table:style-name="co4"/>
				<table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell3' table:style-name="co4"/>				
			</table:table-columns>
			<!-- create header rows -->
			<table:table-rows>
				<table:table-header-rows>
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>
						<table:table-cell><text:p></text:p></table:table-cell>						
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='Heading3' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:value-of select="$labels/item[@id='q-5-2-f']"/></text:p>
						</table:table-cell>
					</table:table-row>

					<xsl:call-template name="emptyRow"/>
					<xsl:call-template name="emptyRow"/>					
					
					<table:table-row   table:default-cell-value-type='string'>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-5-2-f-head1']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-5-2-f-head2']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-5-2-f-head3']"/></text:p></table:table-cell>
						<table:table-cell table:style-name="Heading3"><text:p><xsl:value-of select="$labels/item[@id='q-5-2-f-head4']"/></text:p></table:table-cell>
					</table:table-row>
				</table:table-header-rows>

				<xsl:apply-templates/>									
				
			</table:table-rows>
		</table:table>	
	
	</xsl:template>			
	
	<xsl:template match="q-5-2-f-table-row">

		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell><text:p><xsl:value-of select="q-5-2-f-table-row-prod"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-5-2-f-table-row-categ"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-5-2-f-table-row-quant"/></text:p></table:table-cell>
			<table:table-cell><text:p><xsl:value-of select="q-5-2-f-table-row-units"/></text:p></table:table-cell>
		</table:table-row>

	</xsl:template>
	
	<xsl:template name="buildHeading2">
		<xsl:param name="heading" select="''"/>
		<table:table-row>
			<table:table-cell  table:style-name="Heading2">
				<text:p>
					<xsl:value-of select="$heading"/>
				</text:p>
			</table:table-cell>
		</table:table-row>
	</xsl:template>
	
	<xsl:template name="buildHeading3">
		<xsl:param name="heading" select="''"/>
		<table:table-row>
			<table:table-cell  table:style-name="Heading3">
				<text:p>
					<xsl:value-of select="$heading"/>
				</text:p>
			</table:table-cell>
		</table:table-row>
	</xsl:template>	
	
	<xsl:template name="buildHeading3Table">
		<xsl:param name="heading" select="''"/>
		<xsl:param name="message" select="''"/>		
		<table:table-row>
			<table:table-cell  table:style-name="Heading3">
				<text:p>
					<xsl:value-of select="$heading"/>
				</text:p>
			</table:table-cell>
			<table:table-cell  table:style-name="cell1">
				<text:p>
					<xsl:value-of select="$message"/>
				</text:p>
			</table:table-cell>			
		</table:table-row>
	</xsl:template>		
	
	<xsl:template name="buildQuestion">
		<xsl:param name="q" select="''"/>
		<table:table-cell  table:style-name="Heading3">
			<text:p>
				<xsl:value-of select="$q"/>
			</text:p>
		</table:table-cell>
	</xsl:template>
	
	<xsl:template name="buildLiteralAnswer">
		<xsl:param name="answer" select="''"/>				
			<table:table-cell  table:style-name="cell1">
				<text:p>
					<xsl:value-of select="$answer"/>
				</text:p>
			</table:table-cell>
	</xsl:template>	
	
	<xsl:template name="buildAnswer">
		<xsl:param name="answer" select="''"/>		
		<xsl:param name="yesno" select="'false'"/>		
		<xsl:param name="checkbox" select="'false'"/>		
				
			<table:table-cell  table:style-name="cell1">
				<text:p>
					<xsl:choose>
						<xsl:when test="$yesno='true'">
							<xsl:call-template name="YesNoUnknown">
								<xsl:with-param name="Param" select="."/>
							</xsl:call-template>
						</xsl:when>
						<xsl:when test="$checkbox='true'">
							<xsl:call-template name="Checkbox">
								<xsl:with-param name="Param" select="."/>
							</xsl:call-template>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="."/>
						</xsl:otherwise>
					</xsl:choose>
				</text:p>
			</table:table-cell>
	</xsl:template>

	<!-- YesNoUnknown implementation -->
	<xsl:template name="YesNoUnknown">
		<xsl:param name="Param"/>
		<xsl:choose>
			<xsl:when test="$Param = '1' or $Param = 'true'">Yes</xsl:when>
			<xsl:when test="$Param = '0' or $Param = 'false'">No</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="."/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>		
	
	<xsl:template name="Checkbox">
		<xsl:param name="Param"/>
		<xsl:choose>
			<xsl:when test="$Param = '1' or $Param = 'true'">Yes</xsl:when>
			<xsl:when test="$Param = '0' or $Param = 'false'"></xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="."/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>		

	<xsl:template name="metadata">
		<table:table-row>
			<table:table-cell  table:style-name="Heading4">
				<text:p>Reporting language</text:p>
			</table:table-cell>
			<table:table-cell  table:style-name="cell1">
				<text:p><xsl:value-of select="@xml:lang"/></text:p>
			</table:table-cell>
		</table:table-row>
	</xsl:template>
	
	<xsl:template name="emptyRow">
			<table:table-row>
			<table:table-cell>
				<text:p/>
			</table:table-cell>
		</table:table-row>
	</xsl:template>

</xsl:stylesheet>