Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Previous value in a for-each

From: "Marrow" <m--a-r-r-o-w@--------------------.--->
To: 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)
>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent