Re: About XSL Transformation
| From: | Kelvin Park | Date: | Sun, 29 Jul 2007 21:50:17 +0000 |
| Subject: | Re: About XSL Transformation | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259781@lists.php.net to get a copy of this message | ||
Nathan Nobbe wrote:
this is basically a design decision on your part. since you are working w/ 2 programming languages, ie. php and xsl, you will need to determine how much logic is implemented in each language. i would recommend you devise a scheme early on in your application lifetime and stay consitent w/ the decisions you make. it will save you headaches in the long run. -nathan On 7/29/07, *Kelvin Park* <kelvinpark86@gmail.com <mailto:kelvinpark86@gmail.com>> wrote:Nathan Nobbe wrote:build or modify the xml w/ php. or pickup a book on xsl :) -nathan On 7/29/07, *Kelvin Park* <kelvinpark86@gmail.com<mailto:kelvinpark86@gmail.com><mailto:kelvinpark86@gmail.com <mailto:kelvinpark86@gmail.com>>>wrote:I have an XML file with 10 products with their registered dates(dates when they were created). My XSL code is set so that it sorts the products in descending order(latest to oldest) by registered dates. I tried to declare xsl:variable to increment within xsl:for-each, however I ran in to some dead ends. How do I print only the 5 latest products?-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpThanks!I checked out sitepoint's XSL book, and figured it out. I tried to do it with PHP, for me it seemed just a little bit more work than XSL transformation.Since I'm not very familiar with XSL most of my applications are in PHP and XML (parsed from MYSQL). I have the current project's design planned out with just PHP/XML, however I felt like it was more convenient to just do the latest item print out part with XSL (couple of files). I might run in to some challenges when I get to pagination, I was thinking whether I should deviate a little bit from the plan to create XML/XSL pagination of list of items. This might just become all hybrid code with PHP and XSL, which I'm not looking forward to have.