Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Check against Previous Field value in a for-each Check against Previous Field value in a for-eachTo: NULL Date: 9/2/2007 3:18:00 PM
I have a XML structure like:
- - - -
<EVENTS>
<EVENT>
<EYEAR>2007</EYEAR>
<ENAME>EVENT One</ENAME>
</EVENT>
<EVENT>
<EYEAR>2008</EYEAR>
<ENAME>EVENT Two</ENAME>
</EVENT>
</EVENTS>
- - - -
Then I have a XSL Template with a for each loop. Before the for each loop
I define
a parameter
<xsl:param name="EventYearLast">1999</xsl:param>
<xsl:for-each select="./EVENTS/EVENT">
I want to do some conditional formatting here based on if the <EYEAR>
value
is different from the previoius <EYEAR> value.
something like:
<xsl:if test="EVENTYEAR != $EventYearLast">
<tr>
<td valign="top" colspan="2">
<p align="center"><b<u>
<xsl:value-of select="EVENTYEAR"/>
EVENTS</u></b><br/>
</p>
</td>
</tr>
</xsl:if>
<xsl:param name="EventYearLast"><xsl:value-of
select="EVENTYEAR"/></xsl:param>
</xsl:for-each>
The above does not work because it will not allow the <xsl:param inside the
xsl:for-each loop
HOW DO IT DO THIS??? I've tried several things to no avail. There has got
to be a way. ????
Thank you ahead of time!!
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
