This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: catching the last node still satisfying a condition


> Ainsi parlait Dimitar Peikov :
> > You can't without for-each cycle. because [] operands return 1 recordset
> > not an array. You must set exact match that is enshured that only one
> > element could contain this.
> A cycle for treating one only element ? And recordset are ordered: foo[3] 
> returns the third foo child.
> 
> > You possibly search for :
> >
> > foos/foo[position() = last()]/bar[position() < limit]
> IMHO, this will return all the <bar> child of the last <foo>, whose position 
> regarding their <foo> parent is inferior or egal to limit
> 
> Considering the following situation
> <foo>
>   <foo id="foo1">
>     <bar/>
>   </foo>
>   <foo id="foo2">
>   <bar/>
>   </foo>
>   <foo id="foo3>
>   </foo>
> </foo>
> i would like to catch foo2 with limit = 2 or 3, and foo1 with limit = 1
>

foos/foo[position() &lt; limit]/bar
 
> -- 
> Guillaume Rousse <rousse@ccr.jussieu.fr>
> GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 



-- 
Dimitar Peikov
Programmer Analyst
Globalization Group
"We Build e-Business"  

RILA Solutions  
27 Building, Acad.G.Bonchev Str.  
1113 Sofia, Bulgaria  

phone: (+359 2) 9797320 
phone: (+359 2) 9797300 
fax:   (+359 2) 9733355  
http://www.rila.com 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]