A few ideas:
1. I have been setting up a system to do almost exactly what you are 
doing (database --> xml --> xslt-->html via a custom class) and have not 
noticed any significant performance hit, but this is not in production 
so your mileage may vary, but my gut feeling is the performance hit is 
very small (real scientific - not).

2. Does all this data from your database have to be converted on the 
fly? In other words does it have to be completely dynamic? If some of 
the content is updated fairly infrequently then you could have a 
cron-job type process  convert from database to xml files at a given 
interval (hourly, weekly, montly etc..). Or even think about whether 
your data  needs to live in a database. Can it just live in an xml file?

3. Modern browsers can convert using xslt themselves  so you could check 
the user agent and have the browser transform the xml if it is capable 
(IE5-6, Netscape 6-7, mozilla etc...)

I am going to do all the transformation on the server and  live with the 
slight performance hit.
I think the benefits are worth it. Making and maintaining a site become 
so easy once you have this set up. The code on each page is compact and 
almost exactly the same, the only variance is the sql statement and the 
name of the xsl file.

Go ahead and email me off list if you want to discuss this off list

Chris Boget wrote:

>Let me preface this by saying that I know the benefits of using
>XML with regards to portability and extensibility.
>Here is the issue I face.  I have all of my data stored in a MySQL
>database.  I'm considering reworking my website so that it uses
>XML (after being converted from resultant records in my DB) to 
>transmit & XSLT to transform and display the data to my end user.
>There are a few benifits I can see in sending XML messages as
>part of the back end processing.  However, that seems to be out-
>weighed by the amount of processing that's going to need to take
>place in actually serving the data to the user.  
>First I have to query and pull the records from the database.  Then,
>I need to send those records to a function (or functions) to convert
>it to XML.  Then, I need to take that XML data and have PHP use
>an XSL stylesheet to transform it to HTML before it, finally, gets 
>sent on to the browser.  So that's basically 2 conversions that take
>place on the back end.
>How much experience have any of you had with doing that?  Does 
>it take significantly longer to serve the pages; is there a noticible
>performance hit?  Do you realize more benifit for the back end 
>processes when using XML that makes any additional time it takes 
>to display a page to the user worth it?
>I'd love to hear about people's experience with this kind of thing so I
>can better make a decision wrt whether or not I should even go down
>this route.
>
>thnx,
>Chris
>
>  
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to