Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Previous value in a for-each >Thread Next - Re: Previous value in a for-each Re: Previous value in a for-eachTo: NULL Date: 11/2/2004 9:50:00 AM Hi Jason, > But that this never returns a result > > <xsl:value-of select="/foo/bar[position()=position()-1]/@attrib"/> Of course it won't ever return anything... the predicate [] expression can never evalaute to true. > What I want to do here is look at the last record in a loop to see if I am > at the end of a grouping (begininig of the next actually) Based on what you have described so far (but not seeing more of the XSLT and XML) I'd say it'is unlikely that your current method of doing grouping will work. There are a couple of ways of doing grouping in XSLT 1.0 - the Muenchian Technique and preceding-sibling technique. I'm sure if you post an example of what your are trying to do someone will be able to show you how to do these. Cheers Marrow http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger) http://www.topxml.com/Xselerator "Jason Burr" <JasonBurr@d...> wrote in message news:3CEE074F-AD95-4124-ADD2-8DB46106D9BA@m...... > Can someone explain why doing this writes a number one less than the current > position. > > <xsl:value-of select="position()-1"/> > > Doing this will display a specific positions value > > <xsl:value-of select="/foo/bar[position()=3]/@attrib"/> > > But that this never returns a result > > <xsl:value-of select="/foo/bar[position()=position()-1]/@attrib"/> > > What I want to do here is look at the last record in a loop to see if I am > at the end of a grouping (begininig of the next actually) > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
