
<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:dd786="https://dd.eionet.europa.eu/namespace.jsp?ns_id=786" xmlns:dd797="https://dd.eionet.europa.eu/namespace.jsp?ns_id=797">
    <xsl:template match="dd786:SubUnit"> <office:document-content xmlns:office='http://openoffice.org/2000/office' xmlns:table='http://openoffice.org/2000/table' office:version='1.0' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:number='http://openoffice.org/2000/datastyle' xmlns:text='http://openoffice.org/2000/text' xmlns:fo='http://www.w3.org/1999/XSL/Format' xmlns:style='http://openoffice.org/2000/style'>	<office:automatic-styles>		<style:style style:name='cell1' style:family='table-cell' >			<style:properties fo:text-align='left' fo:font-size='10pt'/>		</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:style>		<style:style style:name='Heading1' style:family='table-cell' >			<style:properties fo:text-align='left' fo:font-size='10pt' fo:font-style='italic' style:text-align-source='fix' fo:font-weight='bold'/>		</style:style>		<style:style style:name='Heading2' style:family='table-cell' >			<style:properties fo:text-align='center' fo:font-size='10pt' fo:font-weight='bold' />		</style:style>	</office:automatic-styles>	<office:body>		<table:table>			<xsl:attribute name="table:name">SubUnit</xsl:attribute>			<table:table-columns>				<table:table-column table:default-cell-value-type='number' table:default-cell-style-name='cell1' >					<xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="count($elementsMetadata/element)"/></xsl:attribute>				</table:table-column>			</table:table-columns>			<!-- create header rows -->			<table:table-rows>				<xsl:apply-templates select="dd786:Row"/>			</table:table-rows>		</table:table>		<xsl:call-template name="DD_Schema_sheet"/>	</office:body></office:document-content></xsl:template><xsl:template match="dd786:Row">		<xsl:if test="position()=1">			<xsl:call-template name="header"/>		</xsl:if>	<table:table-row><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="row" select="."></xsl:variable>
<xsl:for-each xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="$elementsMetadata/element">
   <xsl:variable name="elemIdentifier">
      <xsl:value-of select="identifier"></xsl:value-of>
   </xsl:variable>
   <xsl:variable name="multiValueSeparator">
      <xsl:call-template name="getSeparator">
         <xsl:with-param name="element" select="$elemIdentifier"></xsl:with-param>
      </xsl:call-template>
   </xsl:variable>
   <table:table-cell xmlns:table="http://openoffice.org/2000/table">
      <text:p xmlns:text="http://openoffice.org/2000/text">
         <xsl:choose>
            <xsl:when test="count($row/*[local-name()= $elemIdentifier])=0 or string-join($row/*[local-name()= $elemIdentifier ],'')=''"></xsl:when>
            <xsl:otherwise>
               <xsl:value-of select="string-join($row/*[local-name()= $elemIdentifier ],$multiValueSeparator)"></xsl:value-of>
            </xsl:otherwise>
         </xsl:choose>
      </text:p>
   </table:table-cell>
</xsl:for-each>	</table:table-row></xsl:template><!--  a named template, which creates the table header row --><xsl:template name="header">	<table:table-header-rows>		<table:table-row  table:default-cell-value-type='string' table:default-cell-style-name='Heading2' >
<xsl:for-each xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="$elementsMetadata/element">				<table:table-cell><text:p><xsl:value-of select="identifier" /></text:p> 
				</table:table-cell></xsl:for-each>		</table:table-row>	</table:table-header-rows></xsl:template><!-- Creates a sheet with XML schema, as it is done in DataDcit. Then it's possible to convert Excel back to XML--><xsl:template name="DD_Schema_sheet">	<table:table>		<xsl:attribute name="table:name">DO_NOT_DELETE_THIS_SHEET</xsl:attribute>			<table:table-columns>				<table:table-column table:default-cell-value-type='text' table:default-cell-style-name='cell1' />			</table:table-columns>			<table:table-rows>				<table:table-row>					<table:table-cell>						<text:p>Please do not delete or modify this sheet!!!</text:p>					</table:table-cell>				</table:table-row>				<table:table-row>					<table:table-cell>						<text:p>It is used for converting this file back to XML!</text:p>					</table:table-cell>				</table:table-row>				<table:table-row>					<table:table-cell>						<text:p>Without this possibility your work cannot be used!</text:p>					</table:table-cell>				</table:table-row>				<table:table-row>					<table:table-cell>						<text:p>https://dd.eionet.europa.eu/GetSchema?id=TBL9198</text:p>					</table:table-cell>				</table:table-row>			</table:table-rows>		</table:table></xsl:template>
<xsl:template xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="getSeparator">
   <xsl:param name="element" select="''"></xsl:param>
   <xsl:value-of select="','"></xsl:value-of>
</xsl:template>
<xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="elementsMetadata">
   <element>
      <elementid>78094</elementid>
      <identifier>geometry</identifier>
      <parentNS>797</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76620</elementid>
      <identifier>inspireIdLocalId</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>100</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76623</elementid>
      <identifier>inspireIdNamespace</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>255</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76626</elementid>
      <identifier>inspireIdVersionId</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>25</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76835</elementid>
      <identifier>thematicIdIdentifier</identifier>
      <parentNS>797</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76836</elementid>
      <identifier>thematicIdIdentifierScheme</identifier>
      <parentNS>797</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76738</elementid>
      <identifier>nameTextInternational</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>255</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76739</elementid>
      <identifier>nameText</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>255</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76740</elementid>
      <identifier>nameLanguage</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76725</elementid>
      <identifier>beginLifespanVersion</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76728</elementid>
      <identifier>endLifespanVersion</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76729</elementid>
      <identifier>predecessorsIdentifier</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>255</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76732</elementid>
      <identifier>predecessorsIdentifierScheme</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76733</elementid>
      <identifier>successorsIdentifier</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>255</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76736</elementid>
      <identifier>successorsIdentifierScheme</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76737</elementid>
      <identifier>wiseEvolutionType</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76744</elementid>
      <identifier>designationPeriodBegin</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76746</elementid>
      <identifier>designationPeriodEnd</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76747</elementid>
      <identifier>zoneType</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76770</elementid>
      <identifier>specialisedZoneType</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76774</elementid>
      <identifier>relatedZoneIdentifier</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>100</length>
      <precision></precision>
   </element>
   <element>
      <elementid>76775</elementid>
      <identifier>relatedZoneIdentifierScheme</identifier>
      <parentNS>null</parentNS>
      <type></type>
      <length></length>
      <precision></precision>
   </element>
   <element>
      <elementid>76750</elementid>
      <identifier>link</identifier>
      <parentNS>null</parentNS>
      <type>string</type>
      <length>500</length>
      <precision></precision>
   </element>
</xsl:variable></xsl:stylesheet>
