View stylesheet

XML schemas http://waste.eionet.europa.eu/schemas/waste/schema.xsd
Output type ODS
Description OpenDocument spreadsheet
XSL file dir75442_ods.xsl (Last modified: 07 Apr 2008 10:34 )
<?xml version="1.0" encoding="ISO-8859-1"?>
<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'
>
	<!-- import labels xml file -->
	<xsl:param name="xml_folder_uri"/>
	<xsl:variable name="labels" select="document(concat($xml_folder_uri,'dir75442_labels.xml'))/labels/itemset[@id='75442' and @xml:lang='en']"/>

<xsl:template match="Questionnaire">

<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="10cm"/>
			<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="5cm"/>
			<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="co1" style:family="table-column">
			<style:table-column-properties fo:break-before="auto" style:column-width="13cm"/>
		</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="5cm"/>
		</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:default-cell-value-type='string' table:default-cell-style-name='Heading1' >
						<table:table-cell table:style-name="Heading1">
							<text:p><xsl:copy-of select="$labels/item[@id='h1']/text()"/></text:p>
						</table:table-cell>
						<table:table-cell>
							<text:p></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row>
						<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='Heading2' >
						<table:table-cell table:style-name="Heading2">
							<text:p><xsl:copy-of select="$labels/item[@id='I-h2']/text()"/></text:p>
						</table:table-cell>
					</table:table-row>
				</table:table-header-rows>
				<xsl:apply-templates select="*[starts-with(local-name(.),'Quest75442-I-') and local-name(.)!='Quest75442-I-2-table']"/>
			
				<table:table-row>
					<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='Heading2' >
						<table:table-cell table:style-name="Heading2">>
							<text:p><xsl:copy-of select="$labels/item[@id='II-h2']/text()"/></text:p>
						</table:table-cell>
					</table:table-row>
					<xsl:apply-templates select="*[starts-with(local-name(.),'Quest75442-II-') and local-name(.)!='Quest75442-II-1c-table' and local-name(.)!='Quest75442-II-4-table']"/>

			</table:table-rows>
		</table:table>
		<xsl:apply-templates select="Quest75442-I-2-table"/>
		<xsl:apply-templates select="Quest75442-II-1c-table"/>
		<xsl:apply-templates select="Quest75442-II-4-table"/>
		</office:spreadsheet>
	</office:body>
</office:document-content>
</xsl:template>


		<!-- ##################################          PAGE 1           ############################################-->


	<xsl:template match="Quest75442-I-1a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-I-1b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>


<!-- ##################################       I    2  table           ############################################-->
	
	<xsl:template match="Quest75442-I-2-table">
			<table:table>
			<xsl:attribute name="table:name">I-2 table</xsl:attribute>
			<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='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-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-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:copy-of select="$labels/item[@id='I-2-table']/text()"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string'>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-IDNUTS']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-NumberNUTS']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-WMP']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-PDO']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-PRO']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-RER']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-REUP']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='I-2-Comments']/text()"/></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="Quest75442-I-2-row">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell><text:p>
				<xsl:value-of select="IDNUTS"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="NumberNUTS"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="WMP"/>
				</xsl:call-template>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="PDO"/>
				</xsl:call-template>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="PRO"/>
				</xsl:call-template>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="RER"/>
				</xsl:call-template>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="REUP"/>
				</xsl:call-template>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Comments"/>
			</text:p></table:table-cell>
		</table:table-row>
	</xsl:template>


	<xsl:template match="Quest75442-I-2">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

		<!-- ##################################          PAGE 2           ############################################-->


	<xsl:template match="Quest75442-II-1a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>

<!-- ##################################      II   1c  table           ############################################-->
	
	<xsl:template match="Quest75442-II-1c-table">
		<table:table>
			<xsl:attribute name="table:name">II-1c table</xsl:attribute>
			<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='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-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-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:table-cell table:style-name="Heading2">
							<text:p><xsl:copy-of select="$labels/item[@id='II-1c-table']/text()"/></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="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Authority']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Adoption-publication']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-StartApplication']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-EndApplication']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Domestic-waste']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Hazardous-waste']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Others']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Area-covered']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-1c-Comments']/text()"/></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="Quest75442-II-1c-row">
		<table:table-row   table:default-cell-value-type='string'>
			<table:table-cell><text:p>
				<xsl:value-of select="Authority"/>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Adoption-publication"/>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="StartApplication"/>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="EndApplication"/>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="Domestic-waste"/>
				</xsl:call-template>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:call-template name="YesNoUnknown">
					<xsl:with-param name="Param" select="Hazardous-waste"/>
				</xsl:call-template>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Others"/>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Area-covered"/>
				</text:p>
			</table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Comments"/>
				</text:p>
			</table:table-cell>
		</table:table-row>
	</xsl:template>
	
	<xsl:template match="Quest75442-II-1c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1d-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1d-ii-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1e-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-1e-ii-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-2a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-2b-IfNo">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3c">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-3d">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	
<!-- ##################################      II   4  table           ############################################-->
	
	<xsl:template match="Quest75442-II-4-table">
		<table:table>
			<xsl:attribute name="table:name">II-4 table</xsl:attribute>
			<table:table-columns>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell2' table:style-name="co3"/>
				<table:table-column table:default-cell-value-type='number' 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-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:table-cell table:style-name="Heading2">
							<text:p><xsl:copy-of select="$labels/item[@id='II-4-table']/text()"/></text:p>
						</table:table-cell>
					</table:table-row>
					<table:table-row   table:default-cell-value-type='string'>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-IDYear']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-IDWasteFractions']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Recyled']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Incinerated-with-energy-recovery']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Incinerated']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Landfill']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Other']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Total']/text()"/></text:p></table:table-cell>
							<table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='II-4-Comments']/text()"/></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="Quest75442-II-4-row">
		<table:table-row   table:default-cell-value-type='string' table:default-cell-style-name='cell2'>
			<table:table-cell><text:p>
				<xsl:value-of select="IDYear"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="IDWasteFractions"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Recyled"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Incinerated-with-energy-recovery"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Incinerated"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Landfill"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Other"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Total"/>
			</text:p></table:table-cell>
			<table:table-cell><text:p>
				<xsl:value-of select="Comments"/>
			</text:p></table:table-cell>
		</table:table-row>
	</xsl:template>
	
	<xsl:template match="Quest75442-II-4">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-5a">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-5b-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6a-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6a-ii-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6b-i">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="true()"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="Quest75442-II-6b-ii-IfYes">
		<xsl:call-template name="buildTR">
			<xsl:with-param name="yesno" select="false()"/>
		</xsl:call-template>
	</xsl:template>






	<!-- buid html table TR for one question -->
	<xsl:template name="buildTR">
		<xsl:param name="yesno"/>
		<xsl:param name="label_id" select="substring(local-name(.),12)"/>
		<xsl:variable name="answer">
				<xsl:choose>
					<xsl:when test="$yesno=true()">
						<xsl:call-template name="YesNoUnknown">
							<xsl:with-param name="Param" select="."/>
						</xsl:call-template>
					</xsl:when>
					<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
				</xsl:choose>
		</xsl:variable>
		
		
		<table:table-row>
			<table:table-cell  table:style-name="Heading3">
				<text:p><xsl:copy-of select="$labels/item[@id=$label_id]/text()"/></text:p>
			</table:table-cell>
				<table:table-cell  table:style-name="cell1">
					<text:p><xsl:value-of select="$answer" /></text:p>
				</table:table-cell>
		</table:table-row>
	</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:when test="$Param = ''">Unanswered</xsl:when>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="*"/>

</xsl:stylesheet>