Re: About XSL Transformation

From: Date: Mon, 30 Jul 2007 00:57:04 +0000
Subject: Re: About XSL Transformation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-259788@lists.php.net to get a copy of this message
> I tried to declare xsl:variable to increment within xsl:for-each, > however I ran in to some dead ends. Variables in XSL are not most programmers think of when they hear the term "variable". They are variable in the sense that they can be assigned a value at run-time, but they are really more like constants. Once set, they can't be changed. > How do I print only the 5 latest products? Assuming you've correctly ordered the products by date (dates are handled as strings in XSL, so you'll want to make sure you're using the correct date format to get them to sort correctly), you can add something like "... and position() <= 5" in your node test.

« previous php.general (#259788) next »