|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How Can You Exit an xsl:for-each Loop Prematurely?
My source XML has an element with a set of attributes with the same name e.g.,
<Salesman>
<Orders Order=""/>
<Orders Order=""/>
<Orders Order="zzzzzzzzz"/>
<Orders Order="ee"/>
</Salesman>
To simplify, I am doing the equivalent of trying to find the first non-null
Order, e.g.:
<xsl:for-each select="//Salesman/Orders/@Order">
<xsl:variable name="orderID">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:if test="string-length($orderID) > 0">
..... output something .....
</xsl:if>
</xsl:for-each>
I want only the first output. I do not want multiple outputs.
How could I exit after the first or suppress the additional outputs after I have
found one?
mike
(Embedded
image moved "Harbarth, Juliane" <jhb@xxxxxxxxxxxxxx>
to file: 09/23/99 10:43 AM
pic06086.pcx)
Please respond to xsl-list@xxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxx
cc: (bcc: Michael Teigman/HPG/US/Reuters)
Subject: RE: How Can You Exit an xsl:for-each Loop Prematurely?
> From: Michael Teigman [mailto:michael.teigman@xxxxxxxxxxx]
> Sent: Thursday, September 23, 1999 1:31 AM
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: How Can You Exit an xsl:for-each Loop Prematurely?
>
> Is there some way to exit an xsl:for-each loop before all the nodes have
been
> evaluated?
I can't think of anything to achieve that.
Can you give some more details of what you are trying to do ?
Juliane.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
------------------------------------------------------------------------
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
Reuters Ltd.Attachment:
pic06086.pcx
|
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








