|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Limiting a FOR-EACH loop
Dear Gurnam, You havent explained your problem properly.. I am giving u a solution that limits the no of elements the for-each processes. You can do this using position() function.. the following is an example xml file -------- <elements> <element>element1</element> <element>element2</element> <element>element3</element> <element>element4</element> <element>element5</element> <element>element6</element> <element>element7</element> <element>element8</element> </elements> xsl --- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:for-each select="/elements/element[position() <=5]"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> this will print the values of the first 5 elements.. I dont know if this gives a lead to your problem..please get back if you have any querries Thanks Vasu From: "Gurnam Bedi" <Gurnam.Bedi@xxxxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Limiting a FOR-EACH loop Date: Wed, 18 Sep 2002 12:04:27 -0400 _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








