Re: About XSL Transformation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux