|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: re - newbie question - <xsl: when test
On Thu, Jan 25 '01 at 16:26, Sam Griffiths wrote:
> [ ... ]
> I want to differentiate between the first five <faq>s and the rest so I can
> add appropriate formatting to distinguish between two groups of questions on
> a web page (recent and previous).
>
> The xsl below only selects the *most* recent question - which is equivalent
> to <lastid>.
You're already nearly there
> *XSL*
>
> <xsl:param name="lastid" select="/faqs/lastid"/>
> <xsl:param name="id"/>
>
> ....
>
> <xsl:for-each select="/faqs/faq">
> <xsl:sort select="id" order="descending"/>
> <xsl:choose>
> <xsl:when test="id=$lastid">
<xsl:when test="id > ($lastid - 5)">
> <xsl:element name="A">
> <xsl:attribute name="href">#q<xsl:value-of
> select="id"/></xsl:attribute>
> <font color="red"><xsl:value-of select="question"/></font>
> </xsl:element><br/>
> </xsl:when>
> </xsl:choose>
> </xsl:for-each>
>
You might have to add number() to cenvert it to numbers and it mught
only work with $lastid >= 5. But you'd have to try this.
Cu,
Goetz.
Attachment:
pgp00001.pgp
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








