[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

how to limit number of items shown

Subject: how to limit number of items shown
From: Dmitri Snytkine <d.snytkine@xxxxxxxxx>
Date: Sat, 30 May 2009 21:01:14 -0400
 how to limit number of items shown
Hello!
Sorry to bother you with a simple question.

This is what I a need to acheive:
Suppose I have an RSS feed from a website that may have anywhere from
1 to 25 items inside the <channel> element

So the XML would be like this:
<channel>
  <item>
    <title>some title</title>
    <description>some descrption</description>
  </item>
  <item>
    <title>some title</title>
    <description>some descrption</description>
  </item>
  <item>
    <title>some title</title>
    <description>some descrption</description>
  </item>
</channel>

What I need is a way to make sure I show no more than 10 items, even
if XML has 25 items.

I need this to be done with XSL 1.0 without any extra extensions. This
is for a browser based transformation.
I know XSL 1 does not have a real "for loop", only foreach, which is
why I don't know how to exit from the loop after 'n' items
have been processed.

Please just tell me the way to do this.

Thank you.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.