title: Error in MS excel when generate xls with xslt
body: <p>I want to generate a excel .xls file with xls.
  I've already figured out how to generate the file. Only when opening the file in MS Excel i get the following errors.</p>
  
  <blockquote>
    <p>The file is broken and can not be opened.</p>
  </blockquote>
  
  <p>This is the output;</p>
  
  <pre><code>    enterFile: Order_2013.xls
  
  &lt;?xml version="1.0"?&gt;
  &lt;Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"&gt;&lt;Styles&gt;&lt;Style xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:ID="Default" ss:Name="Normal"&gt;&lt;Alignment ss:Vertical="Bottom"/&gt;&lt;Borders/&gt;&lt;Font/&gt;&lt;Interior/&gt;&lt;NumberFormat/&gt;&lt;Protection/&gt;&lt;/Style&gt;&lt;Style xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:ID="s21"&gt;&lt;Font ss:Size="22" ss:Bold="1"/&gt;&lt;/Style&gt;&lt;Style xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:ID="s22"&gt;&lt;Font ss:Size="14" ss:Bold="1"/&gt;&lt;/Style&gt;&lt;Style xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:ID="s23"&gt;&lt;Font ss:Size="12" ss:Bold="1"/&gt;&lt;/Style&gt;&lt;Style xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:ID="s24"&gt;&lt;Font ss:Size="10" ss:Bold="1"/&gt;&lt;/Style&gt;&lt;/Styles&gt;&lt;Worksheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ss:Name="order"&gt;&lt;Table&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="85"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="115"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="115"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="160"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="115"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="85"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="85"/&gt;&lt;Column ss:AutoFitWidth="0" ss:Width="160"/&gt;&lt;Row ss:AutoFitHeight="0" ss:Height="27.75"&gt;&lt;Cell ss:StyleID="s21"&gt;&lt;Data ss:Type="String"&gt;Example Spreadsheet&lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;Row ss:AutoFitHeight="0" ss:Height="18"&gt;&lt;Cell ss:StyleID="s22"&gt;&lt;Data ss:Type="String"&gt;Vuurvlinderronde 15&lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;Row&gt;&lt;Cell&gt;&lt;Data ss:Type="String"&gt;
                              test
                              &lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;Row xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" ss:AutoFitHeight="0" ss:Height="18"&gt;&lt;Cell ss:StyleID="s23"&gt;&lt;Data ss:Type="String"&gt;
                  Collumn 1
                  &lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;Row xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"&gt;&lt;Cell ss:StyleID="s24"&gt;&lt;Data ss:Type="String"&gt;
                      Collumn 2
                  &lt;/Data&gt;&lt;/Cell&gt;&lt;Cell ss:StyleID="s24"&gt;&lt;Data ss:Type="String"&gt;
                      Collumn 3
                  &lt;/Data&gt;&lt;/Cell&gt;&lt;Cell ss:StyleID="s24"&gt;&lt;Data ss:Type="String"&gt;
                      Collumn 4
                  &lt;/Data&gt;&lt;/Cell&gt;&lt;Cell ss:StyleID="s24"&gt;&lt;Data ss:Type="String"&gt;
                      Collumn 5
                  &lt;/Data&gt;&lt;/Cell&gt;&lt;/Row&gt;&lt;/Table&gt;&lt;/Worksheet&gt;&lt;/Workbook&gt; code here
  </code></pre>
  
  <p>This is the xsl stylesheet</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;?mso-application progid="Excel.Sheet"?&gt;
  
  &lt;files&gt;
  &lt;file filename="Order_%Y%.xls"&gt;
  
  &lt;xsl:stylesheet version="1.0" 
  xmlns:html="http://www.w3.org/TR/REC-html40"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      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"&gt;
  
      &lt;xsl:template match="/"&gt;
  
  &lt;xsl:for-each select="orders/order"&gt;
  
          &lt;Workbook&gt;
              &lt;Styles&gt;
                  &lt;Style ss:ID="Default" ss:Name="Normal"&gt;
                      &lt;Alignment ss:Vertical="Bottom" /&gt;
                      &lt;Borders /&gt;
                      &lt;Font /&gt;
                      &lt;Interior /&gt;
                      &lt;NumberFormat /&gt;
                      &lt;Protection /&gt;
                  &lt;/Style&gt;
                  &lt;Style ss:ID="s21"&gt;
                      &lt;Font ss:Size="22" ss:Bold="1" /&gt;
                  &lt;/Style&gt;
                  &lt;Style ss:ID="s22"&gt;
                      &lt;Font ss:Size="14" ss:Bold="1" /&gt;
                  &lt;/Style&gt;
                  &lt;Style ss:ID="s23"&gt;
                      &lt;Font ss:Size="12" ss:Bold="1" /&gt;
                  &lt;/Style&gt;
                  &lt;Style ss:ID="s24"&gt;
                      &lt;Font ss:Size="10" ss:Bold="1" /&gt;
                  &lt;/Style&gt;
              &lt;/Styles&gt;
  
              &lt;Worksheet ss:Name="order"&gt;
                  &lt;Table&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="85" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="115" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="115" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="160" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="115" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="85" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="85" /&gt;
                      &lt;Column ss:AutoFitWidth="0" ss:Width="160" /&gt;
  
                      &lt;Row ss:AutoFitHeight="0" ss:Height="27.75"&gt;
                          &lt;Cell ss:StyleID="s21"&gt;
                              &lt;Data ss:Type="String"&gt;Voorbeeld&lt;/Data&gt;
                          &lt;/Cell&gt;
                      &lt;/Row&gt;
                      &lt;Row ss:AutoFitHeight="0" ss:Height="18"&gt;
                          &lt;Cell ss:StyleID="s22"&gt;
                              &lt;Data ss:Type="String"&gt;
                                  &lt;xsl:value-of select="shipping/street" /&gt;
                              &lt;/Data&gt;
                          &lt;/Cell&gt;
                      &lt;/Row&gt;
                      &lt;Row&gt;
                          &lt;Cell&gt;
                              &lt;Data ss:Type="String"&gt;
                              test
                              &lt;/Data&gt;
                          &lt;/Cell&gt;
                      &lt;/Row&gt;
  
                      &lt;xsl:call-template name="orders" /&gt;
  
  
                  &lt;/Table&gt;
              &lt;/Worksheet&gt;
  
  
          &lt;/Workbook&gt;
  &lt;/xsl:for-each&gt;
      &lt;/xsl:template&gt;
  
  
  
      &lt;xsl:template name="orders"&gt;
  
          &lt;Row ss:AutoFitHeight="0" ss:Height="18"&gt;
              &lt;Cell ss:StyleID="s23"&gt;
                  &lt;Data ss:Type="String"&gt;
                  Collumn 1
                  &lt;/Data&gt;
              &lt;/Cell&gt;
          &lt;/Row&gt;
          &lt;Row&gt;
              &lt;Cell ss:StyleID="s24"&gt;
                  &lt;Data ss:Type="String"&gt;
                      Collumn 2
                  &lt;/Data&gt;
              &lt;/Cell&gt;
              &lt;Cell ss:StyleID="s24"&gt;
                  &lt;Data ss:Type="String"&gt;
                      Collumn 3
                  &lt;/Data&gt;
              &lt;/Cell&gt;
              &lt;Cell ss:StyleID="s24"&gt;
                  &lt;Data ss:Type="String"&gt;
                      Collumn 4
                  &lt;/Data&gt;
              &lt;/Cell&gt;
              &lt;Cell ss:StyleID="s24"&gt;
                  &lt;Data ss:Type="String"&gt;
                      Collumn 5
                  &lt;/Data&gt;
              &lt;/Cell&gt;
          &lt;/Row&gt;
  
          &lt;xsl:for-each
              select="orders/order"&gt;
  
              &lt;Row&gt;
                  &lt;Cell&gt;
                      &lt;Data ss:Type="String"&gt;
                          &lt;xsl:value-of select="order_id" /&gt;
                      &lt;/Data&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;Data ss:Type="String"&gt;
                          &lt;xsl:value-of select="order_id" /&gt;
                      &lt;/Data&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;Data ss:Type="String"&gt;
                          &lt;xsl:value-of select="order_id" /&gt;
                      &lt;/Data&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;Data ss:Type="String"&gt;
                          &lt;xsl:value-of select="order_id" /&gt;
                      &lt;/Data&gt;
                  &lt;/Cell&gt;
              &lt;/Row&gt;
  
          &lt;/xsl:for-each&gt;
      &lt;/xsl:template&gt;
  
  
  &lt;/xsl:stylesheet&gt;
  
  &lt;/file&gt;
  &lt;/files&gt;
  </code></pre>
  
  <p>I hope someone can point me to the right solution.</p>
  
  <p>Thanks in advance!</p>
  
  <p>J</p>