Converting Excel into XML with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Cigana
Forum Newbie
Posts: 5
Joined: Fri Jan 21, 2011 5:16 am

Converting Excel into XML with PHP

Post by Cigana »

Hello there, I am fairly new to PHP which is quite inconvenient as I have been asked to implement a script that Exports and Excel file into XML according to certain rules. Does anyone know of a (quite detailed) tutorial that could take me through the process?

Many thanks!
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: Converting Excel into XML with PHP

Post by yacahuma »

Peec
Forum Commoner
Posts: 33
Joined: Fri Feb 22, 2008 3:58 am

Re: Converting Excel into XML with PHP

Post by Peec »

I would suggest:
1. Export XLS to to array: http://sourceforge.net/projects/phpexcelreader/
2. Export array to XML: http://snipplr.com/view/3491/convert-ph ... -you-wish/
aquariusjanak
Forum Newbie
Posts: 1
Joined: Tue Jan 25, 2011 6:47 am

Re: Converting Excel into XML with PHP

Post by aquariusjanak »

Peec wrote:I would suggest:
1. Export XLS to to array: http://sourceforge.net/projects/phpexcelreader/
2. Export array to XML: http://snipplr.com/view/3491/convert-ph ... -you-wish/

Nice posting by you.These links are really very good and are very useful.Thanks for the posting.
Cigana
Forum Newbie
Posts: 5
Joined: Fri Jan 21, 2011 5:16 am

Re: Converting Excel into XML with PHP

Post by Cigana »

Thanks guys, I found this one which is also pretty nifty:

https://github.com/shancarter/Mr-Data-Converter

The thing I am finding is that these programs struggle with complex Excel spreadsheets. Once I have managed to convert the documents properly I need to write a debug tool which will compare the results of a console output with the xml file and that's another brain scrambler :) Any ideas on debugging tool tutorials anyone?
Cigana
Forum Newbie
Posts: 5
Joined: Fri Jan 21, 2011 5:16 am

Re: Converting Excel into XML with PHP

Post by Cigana »

Peec wrote:I would suggest:
1. Export XLS to to array: http://sourceforge.net/projects/phpexcelreader//
Peec, this one is really good but PHP seems to be mapping the XML file so that it matches the Excel example, this is what I am finding to difficult to figure out as I am not a PHP programmer I can only understand the overall functionality. Are there scripts out there which offer a more generic solution i.e. being able to nest elements, decide what is an attribute and so on?

Cheers,
User avatar
Irinij1987
Forum Newbie
Posts: 1
Joined: Sun Jan 30, 2011 5:31 pm
Location: Russia
Contact:

Re: Converting Excel into XML with PHP

Post by Irinij1987 »

Это просто отличная мысль
networkgold4u
Forum Newbie
Posts: 1
Joined: Tue Mar 06, 2012 4:32 am
Location: Croatia

Re: Converting Excel into XML with PHP

Post by networkgold4u »

This is what I'm looking for :)
Post Reply