Page 1 of 1

Parsing NumberFormat values in XMLSS (Excel Spreadsheets)

Posted: Mon Jun 12, 2006 9:08 am
by Shocker
Does someone have experience with XML Spreadsheets (XMLSS) from Microsoft (Excel)?
http://msdn.microsoft.com/library/defau ... _xmlss.asp

I need a function, which converts my numbers to the right format depending on the value in <ss:NumberFormat> (in the Style-tag). Unfortunately the documentation doesn't really help, especially when I have such values:

<NumberFormat ss:Format="_-* #,##0.00\ "€"_-;\-* #,##0.00\ "€"_-;_-* "-"??\ "€"_-;_-@_-"/>

Can someone help me? :)

Posted: Wed Jun 14, 2006 5:31 am
by anjanesh
This is new to me ! Is this an API where we can access xls contents via XML ?

Posted: Wed Jun 14, 2006 5:38 am
by Shocker
Well, kind of...In Excel you can save your table as an XML-Spreadsheet and the program generates an XML file with all important contents.
I use this, because I found no other way to parse Excel data with PHP.
The XML file can be parsed by a standard-xml-parser in PHP and it works quite well for my needs. Only the NumberFormat makes headaches :/

I found an PHP Excel reader here (don't know if it reads Excel files or Spreadsheets) but this script uses bit-shifting for the NumberFormat and without documentation there's no way to understand this. :(