Click to See Complete Forum and Search --> : code to read flat file and make it html?


eperez
02-27-2003, 04:01 PM
I have a ms excel sheet with 1500 lines in 3 columns. I want to publish it to the web, however, this file changes daily. i can save the file as a xml, html, xls, dbf file. the web server is an apache with php only.
is there a script that can dinamically read my file, parse it and display it as html?

i dont know if i have to use javascript, php o else...also i am very new to web building.

thanks,
erick.

Charles
02-27-2003, 04:17 PM
Yes, there's an easy way but it has a very steep learning curve. And if you are new to HTML then you are going to need some help.

The basic idea is that you save your spead sheet as XML and then you use XML Style Sheet Language Transformations (XSLT) to transform the XML into HTML. The XSLT processors are written in Java and you can either transform the XML on your desktop and then upload the HTML or you can have your server do the transformation with each HTTP request. And if you really want to wow them, you can have a style sheet that transforms the XML into what are called Formatting Objects (FO). Then you can use an FO processor to generate a PDF version. It takes a lot of setting up, but once everything is in place the process just about runs itself.

Two good XSLT processors are Saxon (http://saxon.sourceforge.net/) and Xalan (http://xml.apache.org/xalan-j/). Saxon has the better help files. For an FO processor I like to use FOP (http://xml.apache.org/fop/).

cscartman
02-27-2003, 04:18 PM
Well theres always text files im sure it should support that but im mostly with mysql so i wouldnt no

eperez
02-28-2003, 11:02 AM
i will try saxon and post back to this list.

i hope it can come with a much cleaner code than the "save as" html/xml function in ms excel xp.

thanks,