View stylesheet

XML schema http://dd.eionet.europa.eu/schemas/Mercury/MercuryAsWaste.xsd
Output type EXCEL
Description MercuryAsWaste EXCEL test preview
XSL file MercuryAsWasteEXCEL.xsl (Last modified: 08 Jun 2020 14:40 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0" xmlns:office="http://openoffice.org/2000/office"
                xmlns:table="http://openoffice.org/2000/table" xmlns:text="http://openoffice.org/2000/text" xmlns:xs="http://www.w3.org/2001/XMLSchema"
				xmlns:d="http://dd.eionet.europa.eu/schemas/Mercury" exclude-result-prefixes="d">
    <xsl:output method="xml"/>

    <xsl:template match="/d:ImportRestrictions">
        <office:document-content xmlns:office="http://openoffice.org/2000/office"
                                 xmlns:table="http://openoffice.org/2000/table" office:version="1.0"
                                 xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:number="http://openoffice.org/2000/datastyle"
                                 xmlns:text="http://openoffice.org/2000/text" xmlns:fo="http://www.w3.org/1999/XSL/Format"
                                 xmlns:style="http://openoffice.org/2000/style">
            <office:automatic-styles>
                <style:style style:name="row-height" style:family="table-cell">
                    <style:properties  style:row-height="2cm" />
                </style:style>
                <style:style style:name="string-cell" style:family="table-cell">
                    <style:properties fo:text-align="left"
                                      fo:font-size="10pt" style:column-width="5cm" />
                </style:style>
                <style:style style:name="long-string-cell" style:family="table-cell">
                    <style:properties fo:text-align="left"
                                      fo:font-size="10pt" style:column-width="15cm" />
                </style:style>
                <style:style style:name="number-cell" style:family="table-cell">
                    <style:properties fo:text-align="right"
                                      fo:font-size="10pt" style:column-width="5cm" />
                </style:style>
                <style:style style:name="long-number-cell" style:family="table-cell">
                    <style:properties fo:text-align="right"
                                      fo:font-size="10pt" style:column-width="10cm" />
                </style:style>
                <style:style style:name="total-number-cell" style:family="table-cell">
                    <style:properties fo:text-align="right" fo:font-weight="bold"
                                      fo:font-size="10pt" style:column-width="5cm" />
                </style:style>
                <style:style style:name="string-heading" style:family="table-cell">
                    <style:properties fo:text-align="left"
                                      fo:font-size="10pt" style:column-width="5cm" fo:font-weight="bold" style:row-height="2cm" />
                </style:style>
                <style:style style:name="long-string-heading" style:family="table-cell">
                    <style:properties fo:text-align="left"
                                      fo:font-size="10pt" style:column-width="10cm" fo:font-weight="bold" />
                </style:style>
                <style:style style:name="cell1" style:family="table-cell">
                    <style:properties fo:text-align="left"
                                      fo:font-size="10pt" style:column-width="5cm" />
                </style:style>
                <style:style style:name="cell2" style:family="table-cell">
                    <style:properties fo:text-align="center"
                                      fo:font-size="12pt" fo:font-style="italic" style:column-width="5cm" />
                </style:style>

                <style:style style:name="Heading2" style:family="table-cell">
                    <style:properties fo:text-align="center"
                                      fo:font-size="10pt" fo:font-weight="bold" style:column-width="5cm" style:row-height="2cm"/>
                </style:style>
                <style:style style:name="long-Heading2" style:family="table-cell">
                    <style:properties fo:text-align="left"
                                      fo:font-size="10pt" fo:font-weight="bold" style:column-width="10cm" style:row-height="2cm"/>
                </style:style>
                <style:style style:name="Heading3" style:family="table-cell">
                    <style:properties fo:text-align="Right"
                                      fo:font-size="10pt" fo:font-weight="bold" style:column-width="5cm" />
                </style:style>
                <style:style style:name="Heading4" style:family="table-cell">
                    <style:properties fo:text-align="right"
                                      fo:font-size="10pt" fo:font-weight="bold" style:column-width="10cm" />
                </style:style>
            </office:automatic-styles>

			<office:body>
				<!-- ImportRestrictions sheet definition -->
				<table:table>
                    <xsl:attribute name="table:name"><xsl:value-of select="'Import Restrictions'" /></xsl:attribute>
                    <xsl:for-each select=".">
                        <table:table-columns>
                            <table:table-column table:default-cell-value-type="string" table:default-cell-style-name="long-string-heading"></table:table-column>
                            <table:table-column table:default-cell-value-type="string" table:default-cell-style-name="long-string-heading"></table:table-column>
                        </table:table-columns>
                        
						<table:table-header-rows>
                            <table:table-row table:default-cell-value-type="string">
                                <table:table-cell table:style-name="Heading2">
                                    <text:p><xsl:value-of select="'ImportRestrictions'"/></text:p>
                                </table:table-cell>
                                <table:table-cell  table:style-name="Heading2">
                                    <text:p></text:p>
                                </table:table-cell>
                            </table:table-row>
                        </table:table-header-rows>
                        
						<table:table-rows>
                            <xsl:call-template name="ImportRestrictions-table"/>
                        </table:table-rows>
                    </xsl:for-each>
				</table:table>
				
				<!-- MercuryAsWaste sheet definition -->
				<table:table>
                    <xsl:attribute name="table:name"><xsl:value-of select="'MercuryAsWaste'" /></xsl:attribute>
                    <!-- <xsl:for-each select="d:Facilities"> -->
                        <table:table-columns>
                            <table:table-column table:default-cell-value-type="string" table:default-cell-style-name="long-string-heading"></table:table-column>
                            <table:table-column table:default-cell-value-type="string" table:default-cell-style-name="long-string-heading"></table:table-column>
							<!-- <table:table-column table:default-cell-value-type="string" table:default-cell-style-name="long-string-heading"></table:table-column> -->
                        </table:table-columns>
                        
						<table:table-header-rows>
                            <table:table-row table:default-cell-value-type="string">
                                <table:table-cell table:style-name="Heading2"><text:p><xsl:value-of select="'MercuryAsWaste'"/></text:p></table:table-cell>
                                <table:table-cell  table:style-name="Heading2"><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:value-of select="'Amount (t/y)'"/></text:p></table:table-cell>
								<table:table-cell table:style-name="Heading2"><text:p><xsl:value-of select="'Purpose'"/></text:p></table:table-cell>
								<!-- <table:table-cell table:style-name="Heading2"><text:p><xsl:value-of select="'otherPurposeDescription'"/></text:p></table:table-cell> -->
                            </table:table-row>
						</table:table-header-rows>

						
						<table:table-rows>
                            <xsl:call-template name="MercuryAsWaste-table"/>
                        </table:table-rows>
                    <!-- </xsl:for-each> -->
				</table:table>

			</office:body>
        </office:document-content>
    </xsl:template>

	<!-- getting data from ImportRestrictions node -->
	<xsl:template name="ImportRestrictions-table">
        <table:table-row table:default-cell-value-type="string">
            <table:table-cell table:style-name="Heading1">
                <text:p>
                    <xsl:value-of select="'Reference Year'"/>
                </text:p>
            </table:table-cell>
            <table:table-cell  table:style-name="cell1">
                <text:p>
                    <xsl:value-of select="d:referenceYear"/>
                </text:p>
            </table:table-cell>
        </table:table-row>
        <table:table-row table:default-cell-value-type="string">
            <table:table-cell table:style-name="Heading1">
                <text:p>
                    <xsl:value-of select="'Has the Member State granted written consent to import mercury or mixtures of mercury for a use allowed in accordance with the second sub-paragraph of Article 4(1) of Regulation (EU) 2017/852?'"/>
                </text:p>
            </table:table-cell>
            <table:table-cell  table:style-name="cell1">
                <text:p>
                    <xsl:value-of select="d:hasGrantedWrittenConsent"/>
                </text:p>
            </table:table-cell>
        </table:table-row>
		<table:table-row table:default-cell-value-type="string">
            <table:table-cell table:style-name="Heading1">
                <text:p>
                    <xsl:value-of select="'Consent description'"/>
                </text:p>
            </table:table-cell>
            <table:table-cell  table:style-name="cell1">
                <text:p>
                    <xsl:value-of select="d:consentDescription"/>
                </text:p>
            </table:table-cell>
        </table:table-row>	
		<table:table-row table:default-cell-value-type="string">
            <table:table-cell table:style-name="Heading1">
                <text:p>
                    <xsl:value-of select="'Has a copy of the form(s) used to grant or deny written consent on import pursuant to the second subparagraph of Article 4(1) of Regulation (EU) 2017/852 during the reporting year N-1 been sent?'"/>
                </text:p>
            </table:table-cell>
            <table:table-cell  table:style-name="cell1">
                <text:p>
                    <xsl:value-of select="d:hasSentCopyOfForms"/>
                </text:p>
            </table:table-cell>
        </table:table-row>
	</xsl:template>
	
	<!-- getting data from facilities node -->
	<xsl:template name="MercuryAsWaste-table">
		<xsl:for-each select="d:MercuryAsWaste">
			<table:table-row table:default-cell-value-type="string">
				<table:table-cell  table:style-name="cell1"><text:p><xsl:value-of select="d:amount"/></text:p></table:table-cell>
				<table:table-cell  table:style-name="cell1"><text:p><xsl:value-of select="d:purpose"/></text:p></table:table-cell>
			</table:table-row>
		</xsl:for-each>
	</xsl:template>


	
</xsl:stylesheet>