View stylesheet

XML schema http://dd.eionet.europa.eu/schemas/ods-2022/ODSReport.xsd
Output type XML
Description Convert ODS submission from 2023 to 2024 format
XSL file ODS_2023-2024.xsl (Last modified: 25 Jan 2024 09:36 )
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  >

  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
  <xsl:strip-space elements="*" />


  <xsl:template match="node()|@*" name="identity">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>
 

  <xsl:template match="@*[name() = 'xsi:noNamespaceSchemaLocation']">
    <xsl:attribute name="{name()}">http://dd.eionet.europa.eu/schemas/ods-2023/ODSReport.xsd</xsl:attribute>
  </xsl:template>



  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="ODSReporting/ODSQuantities/TotalProduction/Comments"/>


  
  <xsl:template match="ODSReporting/ODSQuantities/TotalImports">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:copy-of select="node()"/>
      <xsl:if test="not(./Comments)">
        <Comments/>
      </xsl:if>
    </xsl:copy>
  </xsl:template>



  <xsl:template match="ODSReporting/ODSQuantities/ExportFromEU">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:copy-of select="node()"/>
      <xsl:if test="not(./Comments)">
        <Comments/>
      </xsl:if>
    </xsl:copy>
  </xsl:template>

  
  
  <xsl:template match="ODSReporting/ODSQuantities/ExportFromEU/ExportQuantity">
    <xsl:if test="(./CustomsProcedure) and (./CustomsProcedure) != ''">      
      <xsl:copy>
        <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
    </xsl:if>
  </xsl:template>



  <xsl:template match="ODSReporting/ODSQuantities/Destruction">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:copy-of select="node()"/>
      <xsl:if test="not(./Comments)">
        <Comments/>
      </xsl:if>
    </xsl:copy>
  </xsl:template>

 

</xsl:stylesheet>