Parsing NumberFormat values in XMLSS (Excel Spreadsheets)

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Shocker
Forum Newbie
Posts: 2
Joined: Mon Jun 12, 2006 9:03 am

Parsing NumberFormat values in XMLSS (Excel Spreadsheets)

Post 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? :)
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

This is new to me ! Is this an API where we can access xls contents via XML ?
Shocker
Forum Newbie
Posts: 2
Joined: Mon Jun 12, 2006 9:03 am

Post 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. :(
Post Reply