XML schema |
http://air-climate.eionet.europa.eu/schemas/dir199913ec/schema.xsd
|
---|---|
Output type | ODS |
Description | OpenDocument spreadsheet |
XSL file | dir199913_ods.xsl (Last modified: 03 Apr 2008 16:51 ) |
<?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' > <xsl:param name="xml_folder_uri"/> <xsl:param name="language" select="'en'"/> <!-- import labels xml file --> <xsl:variable name="labels_doc" select="document(concat($xml_folder_uri,'dir199913_labels.xml'))/labels"/> <xsl:variable name="labels" select="$labels_doc/itemset[@id='199913' and @xml:lang=$language]"/> <xsl:variable name="labels_yesno" select="$labels_doc/itemset[@id='yesno' and @xml:lang=$language]"/> <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="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="5cm"/> <style:text-properties fo:font-size='10pt'/> <style:paragraph-properties fo:text-align="justify"/> </style:style> <style:style style:name='cell4' style:family='table-cell' > <style:properties fo:text-align='justify' fo:font-size='10pt' style:column-width="1cm"/> <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="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="5cm"/> </style:style> <style:style style:name="co4" style:family="table-column"> <style:table-column-properties fo:break-before="auto" style:column-width="1cm"/> </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-header-rows> <xsl:apply-templates select="*[local-name(.)!='Quest199913-q2-table']"/> </table:table-rows> </table:table> <xsl:apply-templates select="Quest199913-q2-table"/> </office:spreadsheet> </office:body> </office:document-content> </xsl:template> <!-- ################################## PAGE 1 ############################################--> <xsl:template match="Quest199913-q1-a"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q1-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q1-b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <!-- ################################## question 2 table ############################################--> <xsl:template match="Quest199913-q2-table"> <xsl:variable name="sheet_name"><xsl:copy-of select="$labels/item[@id='q2-table-h2']/text()"/></xsl:variable> <table:table> <xsl:attribute name="table:name"> <xsl:choose> <xsl:when test="string-length($sheet_name) > 0"><xsl:value-of select="$sheet_name"/></xsl:when> <xsl:otherwise>2. Coverage of installations</xsl:otherwise> </xsl:choose> </xsl:attribute> <table:table-columns> <table:table-column table:default-cell-value-type='string' table:default-cell-style-name='cell4' table:style-name="co4"/> <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='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-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="Heading3"><text:p/></table:table-cell> <table:table-cell table:style-name="Heading2"> <text:p><xsl:copy-of select="$labels/item[@id='q2-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/></table:table-cell> <table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='q2-col1']/text()"/></text:p></table:table-cell> <table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='q2-col2']/text()"/></text:p></table:table-cell> <table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='q2-col3']/text()"/></text:p></table:table-cell> <table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='q2-col4']/text()"/></text:p></table:table-cell> <table:table-cell table:style-name="Heading3"><text:p><xsl:copy-of select="$labels/item[@id='q2-col5']/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="Quest199913-q2-row"> <table:table-row table:default-cell-value-type='string'> <table:table-cell> <text:p> <xsl:value-of select="Activity/@code"/> </text:p> </table:table-cell> <table:table-cell> <text:p> <xsl:value-of select="Activity"/> </text:p> </table:table-cell> <table:table-cell> <text:p> <xsl:value-of select="Existing-installations"/> </text:p> </table:table-cell> <table:table-cell> <text:p> <xsl:value-of select="Registered-installations"/> </text:p> </table:table-cell> <table:table-cell> <text:p> <xsl:value-of select="Registered-Art4-installations"/> </text:p> </table:table-cell> <table:table-cell> <text:p> <xsl:value-of select="IPPC-installations"/> </text:p> </table:table-cell> </table:table-row> </xsl:template> <xsl:template match="Quest199913-q2-comments"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q2-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q2-table'"/> </xsl:call-template> <!--xsl:call-template name="buildAnswer"/--> </xsl:template> <xsl:template match="Quest199913-q3"> <xsl:call-template name="buildHeading"/> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q4-a"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q4-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q4'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q4-b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q5-1a"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q5-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q5-1'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"> <xsl:with-param name="yesno" select="true()"/> </xsl:call-template> </xsl:template> <xsl:template match="Quest199913-q5-1b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q5-1c"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q5-2a"> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q5-2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q5-2b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q5-2c"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q6-1"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q6-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"> <xsl:with-param name="yesno" select="true()"/> </xsl:call-template> </xsl:template> <xsl:template match="Quest199913-q6-2a"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q6-2b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q6-2c"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q6-2d"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q7"> <xsl:call-template name="buildHeading"/> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q8-1a"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q8-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q8-1'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q8-1b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q8-1c"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q8-2a"> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q8-2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q8-2b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q8-3"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q9-a"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q9-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q9-text'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q9-b"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q9-c"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q9-c-comments"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q10-1"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q10-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q10-1a"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q10-2"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q10-2a"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q11-1"> <xsl:call-template name="buildHeading"> <xsl:with-param name="label_id" select="'q11-h2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q11-1a"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q11-2-1"> <xsl:call-template name="buildQuestion"> <xsl:with-param name="label_id" select="'q11-2'"/> </xsl:call-template> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q11-2-2"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q11-2-3"> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q12"> <xsl:call-template name="buildHeading"/> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q13"> <xsl:call-template name="buildHeading"/> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <xsl:template match="Quest199913-q14"> <xsl:call-template name="buildHeading"/> <xsl:call-template name="buildQuestionAndAnswer"/> </xsl:template> <!-- TEMPLATES for building Spreadsheet elements --> <!-- buid html for the first level heading --> <xsl:template name="buildHeading"> <xsl:param name="label_id" select="concat(substring(local-name(.),13),'-h2')"/> <table:table-row> <table:table-cell table:style-name="Heading2"> <text:p> <xsl:copy-of select="$labels/item[@id=$label_id]/text()"/> </text:p> </table:table-cell> </table:table-row> </xsl:template> <!-- buid html for one question --> <xsl:template name="buildQuestionAndAnswer"> <xsl:param name="label_id" select="substring(local-name(.),13)"/> <xsl:param name="yesno"/> <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-row> <xsl:call-template name="buildAnswer"> <xsl:with-param name="yesno" select="$yesno"/> </xsl:call-template> </xsl:template> <xsl:template name="buildQuestion"> <xsl:param name="label_id" select="substring(local-name(.),13)"/> <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-row> </xsl:template> <xsl:template name="buildAnswer"> <xsl:param name="yesno"/> <table:table-row> <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:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </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'"> <xsl:copy-of select="$labels_yesno/item[@id='1']/text()"/> </xsl:when> <xsl:when test="$Param = '0' or $Param = 'false'"> <xsl:copy-of select="$labels_yesno/item[@id='0']/text()"/> </xsl:when> <xsl:when test="$Param = ''"> <xsl:copy-of select="$labels_yesno/item[@id='']/text()"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="*"/> </xsl:stylesheet>
European Environment Agency
Kgs. Nytorv 6, DK-1050 Copenhagen K, Denmark