"Chris Boget" <[EMAIL PROTECTED]> wrote... :
> Let me preface this by saying that I know the benefits of using > XML with regards to portability and extensibility. Yes, there are many benefits. > 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. It is indeed a very elegant way of creating dynamic sites. > 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. True, it is more that just embedding PHP variables into an HTML templates. > First I have to query and pull the records from the database. Ideally, you could also store some text XML-formatted already in DB. Always, if that makes sense. I do it for the article, long texts to be formatted. > Then, > I need to send those records to a function (or functions) to convert > it to XML. Try modulate it with Classes. (an extra overhead, I know, but adds you the portability.. which, I believe is important for you) > 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. Before actually send it to the browser, save (cache) the HTML file to your local system, so them later you can reuse it directly should no data change in between. > How much experience have any of you had with doing that? Many do that. You can create some real dynamic sites, skins etc.. > Does > it take significantly longer to serve the pages; is there a noticible > performance hit? If well designed, the overhead will only be some few milliseconds. This is not much, considering that now the machines get faster and faster. > 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? Yes, having a more dynamic site means less efforts on additional eventual features to implement. Thus, not only the extra 100 milliseconds for user to wait, but rather the cheaper maintaining costs and higher quality. It often means cheaper services in some businesses. > 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. I would go for it (in fact I working myself on similar system these days). One thing I'd recommend you is to invest some relatively sufficient time on studying well the application design so you can make it as dynamic as possible. For speed purpose, you should organize yourself a caching system. An idea would be tracking down the changes on the DB and saving all rendered HTML files to then compare on the request and reuse unchanged sections of the website. It, of course, depends 85% on your application data, logic and specifications. So, invest enough time, prepare your database for cache and add XML/XSLT/PHP trio. Good luck! -- Maxim Maletsky [EMAIL PROTECTED] www.PHPBeginner.com // where PHP Begins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php