[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL function help required

Subject: RE: XSL function help required
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 21 Jul 2000 08:40:26 +0100
xsl limit select
>Rating: 1 2 3 4 5 6 7 8 9 10

Something like:

<xsl:template name="ratings">
   <xsl:param name="limit" select="10"/>
   <xsl:param name="this" select="1"/>
   <xsl:param name="emph"/>
   <xsl:choose>
   <xsl:when test="$this=$emph"><b>&#xa0; <xsl:value-of
select="$this"/></b></xsl:when>
   <xsl:otherwise>>&#xa0; <xsl:value-of select="$this"/></xsl:otherwise>
   </xsl:choose>
   <xsl:if test="$this &lt; $limit">
         <xsl:call-template name="ratings">
             <xsl:with-param name="limit" select="$limit"/>
             <xsl:with-param name="this" select="$this+1"/>
             <xsl:with-param name="emph" select="$emph"/>
         </xsl:call-template>
    </xsl:if>
</xsl:template>

Mike Kay

> -----Original Message-----
> From:	Madhu Menon [SMTP:madhu@xxxxxxxxxxxxxxx]
> Sent:	Thursday, July 20, 2000 10:24 PM
> To:	xsl-list@xxxxxxxxxxxxxxxx
> Subject:	XSL function help required
> 
> I presently have an XML tag stored as so:
> 
> <rating> 7 </rating>
> 
> It is essentially for rating a product out of a possible score of 10.
> 
> What I want to do is to convert it like this:
> 
> Rating: 1 2 3 4 5 6 7 8 9 10
> 
> where the "7" will be made BOLD.
> 
> If the rating were 5, the same string has to be generated, except that
> this 
> time, the 5 must be made bold.
> 
> Does anyone have an idea about how I'd do this with XSL?
> 
> TIA,
> 
> Madhu
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.