[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Break the For-each loop
xsl:for-each is a mapping, not a loop: it maps an input sequence to a result sequence. It doesn't process the input elements in any particular order, therefore the concept of "breaking out" doesn't make sense. If you only want to process the elements up to the first apple, you first need to select those elements. For example: <xsl:for-each select="apple[1] | apple[1]/preceding-sibling::*)"> ... </xsl:for-each> Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Khorasani, Houman [mailto:houman_khorasani@xxxxxxxxxxxxxx] > Sent: 09 September 2005 10:36 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Break the For-each loop > > Hello, > > I would like to look after a specific XML tag (e.g. apple), which can > occur several times. I was thinking using a for-each loop and output > the first found apple. But I would get in this case all the apples > because of the for-each loop. So how do I break the loop after I have > found the first apple? > > Thanks > Houman
|
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
|