views:

415

answers:

3

Hello

I am exporting an excel workbook into xml spreadsheet The excel has lets say 10 columns and 10 rows Some of the cells are empty(i.e with no value) When i save the file into xml spreadsheet and review the row that has blank cell in it it has only cells, the cell with the empty value is not there and the xml show that the cell before the blank and the cell after the blank are one after another (the empty cell just dont exists)

here is a sample of the xml:

<Cell ss:StyleID="s36"><Data ss:Type="Number">cell1</Data><NamedCell
  ss:Name="Print_Area"/></Cell>
<Cell><Data ss:Type="String">cell2</Data><NamedCell ss:Name="Print_Area"/></Cell>
<Cell><Data ss:Type="String">cell4</Data><NamedCell
  ss:Name="Print_Area"/></Cell>

The missing cell is cell3

Any idea anyone ?

Thanks in advance IB

+1  A: 

If the cell is empty this seems a reasonable optimization to save space - why should it not be missing.

You have enough information to recreate the original spreadsheet

Mark
I am using an xsl to transform this xml into my own xml schemaI am unable to know that the cell is missingnow if i connect a value into a header (places on first row) i end up with a value not connected to the correct header because of the gap
IB
Then you have a bad schema design.
RBarryYoung
I am not using any schema,I just want to save the excel as xml spreadsheet with preserving the empty cells
IB
It does preserver the empty cells - a missing cell at A1 is treated the same as ZZ16000
Mark
A: 

Is there a way to ask excel not to save space ? The recration is not that easy as it seems using xslt?

IB
A: 

Exactly where is the information stored that lets him recreate the spreadsheet? If these rows:

  • Data, empty, Data, empty, Data
  • Data, Data, Data, empty, empty
  • Data, empty, empty, Data, Data

all give

  • Row
  • Cell Data /Data /Cell
  • Cell Data /Data /Cell
  • Cell Data /Data /Cell
  • /Row
StrefanA
I am not currently near the computer where i develop but as i remember when you export there are attributes to each element and one of them lets you know which row is it exactly (when he jumps rows he add this attribute to the next row with data), i just looped over this elements with attributes and created the missing rows as i needed everything in the xml
IB
There is an Index: in the Row or Cell start tag that seems to say "I am Row this" or "I am Cell that" .. If you're expecting Row 8 but find Index:10 in a new Row tag you add an empty Row 8 and 9
StrefanA