Subject: Re: [xsl] Comparing an XML value from current record and previous record From: Steve <subsume@xxxxxxxxx> Date: Thu, 10 May 2007 10:37:56 -0400 |
<xsl:if test="HORSE_FRONT_ROW_FLAG='2' AND preceding-sibling::HORSE_FRONT_ROW_FLAG='1'"> <printStuff /> </xsl:if>
Hi,
I am new to XSL and have some code that I need edited.
We are currently looping through an XML recordset.
We need an if statement that checks the current and previous record's value of the XML tag "HORSE_FRONT_ROW_FLAG". If the current record's value of HORSE_FRONT_ROW_FLAG tag is "2", and the previous record's value of HORSE_FRONT_ROW_FLAG is "1", then the system needs to print some text....
This is the current code:
<xsl:for-each select="RACE_LIST_HORSES/HORSE"> <section startonnewpage="false" pagesize="a5" leftmargin="1cm" rightmargin="1cm" topmargin="1cm" bottommargin="1cm"> <paragraph type="textparagraph" alignment="center"> <fragment font="Helvetica" fontsize="10"> ------------------------------------------------ Second Row ------------------------------------------------</fragment> </paragraph> </section> The current code is below. xsl:for-each select="RACE_LIST_HORSES/HORSE"> <section startonnewpage="false" pagesize="a5" leftmargin="1cm" rightmargin="1cm" topmargin="1cm" bottommargin="1cm">
</section>
</xsl:for-each>
Here is the pseudocode for what I need implemented...
<xsl:for-each select="RACE_LIST_HORSES/HORSE"> <section startonnewpage="false" pagesize="a5" leftmargin="1cm" rightmargin="1cm" topmargin="1cm" bottommargin="1cm">
<if current Record's value for RACE_LIST_HORSES/HORSE/HORSE_FRONT_ROW_FLAG = 2> <if previous record's if current Record's value for RACE_LIST_HORSES/HORSE/HORSE_FRONT_ROW_FLAG = 1> <section startonnewpage="false" pagesize="a5" leftmargin="1cm" rightmargin="1cm" topmargin="1cm" bottommargin="1cm"> <paragraph type="textparagraph" alignment="center"> <fragment font="Helvetica" fontsize="10"> ------------------------------------------------ Second Row ------------------------------------------------</fragment> </paragraph> </section> <end if> <end if>
</section>
</xsl:for-each>
From what I've read you need to use preceding for the previous record only, but I have no idea how to implement it within the if statement.
Any help would be greatly appreciated
Send instant messages to your online friends http://au.messenger.yahoo.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Comparing an XML value from c, Brett Luntz | Thread | Re: [xsl] Comparing an XML value fr, Abel Braaksma |
[xsl] Comparing an XML value from c, Brett Luntz | Date | Re: [xsl] "re-calling" template par, Wendell Piez |
Month |