xsl-list
[Top] [All Lists]

Re: [xsl] how to limit number of items shown

2009-05-31 01:05:46
On Sun, May 31, 2009 at 6:31 AM, Dmitri Snytkine 
<d(_dot_)snytkine(_at_)gmail(_dot_)com> wrote:
What I need is a way to make sure I show no more than 10 items, even
if XML has 25 items.

I think, you can do:

<xsl:for-each select="item[position() &lt; 11]">
 ..
</xsl:for-each>

you only iterate the items you are interested in.

I know XSL 1 does not have a real "for loop", only foreach

From the point of view of XSLT, xsl:for-each loop is real :)

btw, with XSLT 2.0 one can do (not possible in 1.0):

<xsl:for-each select="1 to 10">
   ..
</xsl:for-each>


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>