Unable to identify / open this file, opens normally in excel / libreoffice

Topics: Developer Forum, User Forum
Oct 3, 2012 at 1:10 PM

Hi everyone,

I'm trying to identify / open this file with PhpExcel 1.7.7, php 5.3, ubuntu linux :

http://www.chupitojs.com/test.xml

Identify() incorrectly returns "CSV". I tried forcing the excel readers, but they fail in opening it.

Here's an excerpt, can you recognize the format?

<?xml version='1.0'?>
<?mso-application progid='Excel.Sheet'?>
<s:Workbook xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:s="urn:schemas-microsoft-com:office:spreadsheet">
  <s:Styles>
    <s:Style s:ID="header">
      <s:Borders>
        <s:Border s:Color="LightGray" s:Position="Top" s:LineStyle="Continuous" s:Weight="1" />
[...]
  <s:Worksheet s:Name="Generale---Tipo">
    <s:Table>
      <s:Column s:Width="96" />
      <s:Column s:Width="96" />
      <s:Column s:Width="48" />
      <s:Row>
        <s:Cell s:StyleID="header">
          <s:Data s:Type="String" />
        </s:Cell>
        <s:Cell s:StyleID="header">
          <s:Data s:Type="String" />
        </s:Cell>
        <s:Cell s:StyleID="header">
          <s:Data s:Type="String" />
        </s:Cell>
      </s:Row>
      <s:Row>
        <s:Cell s:StyleID="header">
          <s:Data s:Type="String">Data</s:Data>
        </s:Cell>
        <s:Cell s:StyleID="header">
          <s:Data s:Type="String">Tipologia</s:Data>
        </s:Cell>
        <s:Cell s:StyleID="header">
          <s:Data s:Type="String">Rooms</s:Data>
        </s:Cell>
      </s:Row>
      <s:Row>
        <s:Cell s:StyleID="body">
          <s:Data s:Type="String">ven 07/09/12</s:Data>
        </s:Cell>
        <s:Cell s:StyleID="body">
          <s:Data s:Type="String">San Biagio Classic Monastero</s:Data>
        </s:Cell>
        <s:Cell s:StyleID="body">
          <s:Data s:Type="Number">3</s:Data>
        </s:Cell>

Any help is greatly appreciated.

Coordinator
Oct 3, 2012 at 4:21 PM

Looks like spreadsheetML, which should be readable using the Excel2003XML Reader

Oct 3, 2012 at 4:33 PM

If I force the Excel2003XML reader, I get this exception on listWorksheetNames()...any idea what I can do to open such a file? it's a report coming out from a software, there's no way to change the format...

Exception: /var/www/revlight/upload/0020/protel_1349281787.xml is an Invalid Spreadsheet file.

File Line Instruction
.../PHPExcel/Reader/Excel2003XML.php
239
throw Exception()
.../calendar/import_file.php
92
PHPExcel_Reader_Excel2003XML->listWorksheetNames( '/var/www/revlight/upload/...020/protel_1349281787.xml')
Coordinator
Oct 3, 2012 at 8:05 PM

I'd need to look at the code and see exactly what it was doing at this point

Coordinator
Oct 3, 2012 at 8:05 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.