cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geert Josten" <>
Subject RE: Urgent :break statement in xsl
Date Wed, 28 Jun 2006 08:48:21 GMT

Your question is actually better of on the Mulberry XSL list, but
perhaps here something that will help you..

> <xsl:variable name="daslcatagorypath" select="'/nos'"/>  
> <xsl:for-each select="details/dasl:query-result/dasl:resource"> 
>         <xsl:if test="d:resourcetype=''"> 
>         <xsl:variable name="daslfolderpath"><xsl:value-of 
> select="@dasl:path"/></xsl:variable> 
>         <xsl:variable name="check" 
> select="substring-after($daslfolderpath,$daslcatagorypath)"/> 
>         <xsl:if test="$check!='' and $counter='1'"> 
>                 <xsl:variable name="size" 
> select="d:getcontentlength"/> 
>                 <xsl:variable name="kb-size" select="($size 
> div 1000) - ($size mod 1000 div 1000)"/> 
>                 <xsl:value-of select="$kb-size"/><xsl:text> 
> </xsl:text>KB 
>                 <xsl:variable name="counter" select="'0'"/> 
>         </xsl:if> 
>         </xsl:if>
> </xsl:for-each> 

If you are only interested in one occurrence of a list of nodes, why not
selecting just one, instead of looping over the list and triggering for
one case?

First of all, you can add the check statement into the select by putting
it in a predicate:



th, $daslcatagorypath)]"

And if you are only interested in the first (in document order), put the
lot between braces and add [1] to the end:

ath, $daslcatagorypath)])[1]"

This expression always results in one node, ruling out the need for a
for-each. That should circumvent your problem..

Kind regards,
Drs. G.P.H. Josten

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199

De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen,
verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message