﻿<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output indent="yes" method="xml"/>
  <xsl:decimal-format name="it"  grouping-separator="." decimal-separator="," />
  <xsl:variable name="Inventario" select="//Inventario" />
  <xsl:variable name="DocumentProperties" select="//DocumentProperties" />
  <xsl:variable name="OfficeDocumentSettings" select="//OfficeDocumentSettings" />
  <xsl:variable name="ExcelWorkbook" select="//ExcelWorkbook" />
  <xsl:variable name="Styles" select="//Styles" />
  #VAR_HEADERS#
  <xsl:template match="/">
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:o="urn:schemas-microsoft-com:office:office"
     xmlns:x="urn:schemas-microsoft-com:office:excel"
     xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:html="http://www.w3.org/TR/REC-html40">
      <xsl:apply-templates select="//DocumentProperties" />
      <xsl:apply-templates select="//OfficeDocumentSettings" />
      <xsl:apply-templates select="//ExcelWorkbook" />
      <Styles>
        <xsl:apply-templates select="//Styles" />
      </Styles>
      #APPLY_HEADERS#
    </Workbook>
  </xsl:template>
  
  <xsl:template match="//DocumentProperties">
    <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
      <Author>
        <xsl:value-of select="$DocumentProperties/Author"/>
      </Author>
    </DocumentProperties>
  </xsl:template>

  <xsl:template match="//OfficeDocumentSettings">
    <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
      <AllowPNG>
        <xsl:value-of select="AllowPNG"/>
      </AllowPNG>
    </OfficeDocumentSettings>
  </xsl:template>

  <xsl:template match="//ExcelWorkbook">
    <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
      <WindowHeight>
        <xsl:value-of select="WindowHeight"/>
      </WindowHeight>
      <WindowWidth>
        <xsl:value-of select="WindowWidth"/>
      </WindowWidth>
      <WindowTopX>
        <xsl:value-of select="WindowTopX"/>
      </WindowTopX>
      <WindowTopY>
        <xsl:value-of select="WindowTopY"/>
      </WindowTopY>
      <ProtectStructure>
        <xsl:value-of select="ProtectStructure"/>
      </ProtectStructure>
      <ProtectWindows>
        <xsl:value-of select="ProtectWindows"/>
      </ProtectWindows>
    </ExcelWorkbook>
  </xsl:template>

  <xsl:template match="//Styles">
      <Style>
        <xsl:attribute name="ID" namespace="urn:schemas-microsoft-com:office:spreadsheet">
          <xsl:value-of select="ID"/>
        </xsl:attribute>
        <Alignment>
          <xsl:attribute name="Vertical" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="AlignmentVertical"/>
          </xsl:attribute>
          <xsl:attribute name="Horizontal" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="AlignmentHorizontal"/>
          </xsl:attribute>
        </Alignment>
        <Borders>
          <Border>
            <xsl:attribute name="Position" namespace="urn:schemas-microsoft-com:office:spreadsheet">Bottom</xsl:attribute>
            <xsl:attribute name="LineStyle" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderLineStyle"/>
            </xsl:attribute>
            <xsl:attribute name="Weight" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderWeight"/>
            </xsl:attribute>
          </Border>
          <Border>
            <xsl:attribute name="Position" namespace="urn:schemas-microsoft-com:office:spreadsheet">Left</xsl:attribute>
            <xsl:attribute name="LineStyle" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderLineStyle"/>
            </xsl:attribute>
            <xsl:attribute name="Weight" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderWeight"/>
            </xsl:attribute>
          </Border>
          <Border>
            <xsl:attribute name="Position" namespace="urn:schemas-microsoft-com:office:spreadsheet">Right</xsl:attribute>
            <xsl:attribute name="LineStyle" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderLineStyle"/>
            </xsl:attribute>
            <xsl:attribute name="Weight" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderWeight"/>
            </xsl:attribute>
          </Border>
          <Border>
            <xsl:attribute name="Position" namespace="urn:schemas-microsoft-com:office:spreadsheet">Top</xsl:attribute>
            <xsl:attribute name="LineStyle" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderLineStyle"/>
            </xsl:attribute>
            <xsl:attribute name="Weight" namespace="urn:schemas-microsoft-com:office:spreadsheet">
              <xsl:value-of select="BorderWeight"/>
            </xsl:attribute>
          </Border>
        </Borders>
        <Font>
          <xsl:attribute name="FontName" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="FontName"/>
          </xsl:attribute>
          <xsl:attribute name="Family" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="FontFamily"/>
          </xsl:attribute>
          <xsl:attribute name="Size" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="FontSize"/>
          </xsl:attribute>
          <xsl:attribute name="Color" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="FontColor"/>
          </xsl:attribute>
          <xsl:attribute name="Bold" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="FontBold"/>
          </xsl:attribute>
        </Font>
        <Interior/>
        <NumberFormat>
          <xsl:attribute name="Format" namespace="urn:schemas-microsoft-com:office:spreadsheet">
            <xsl:value-of select="NumberFormat"/>
          </xsl:attribute>
        </NumberFormat>
        <Protection/>
      </Style>
  </xsl:template>
    
  
#HEADERS#
  
 
</xsl:stylesheet>
