xsl-list
[Top] [All Lists]

Re: [xsl] No of Times Named Template called

2008-03-13 14:37:35
Hi
Am passing my-param as 'S' .
I understand that I need to do something like Micael Kay Suggested .
How do I
 (a) process the input twice, once to produce the images, once to produce the
counts

 (b) capture the output in a variable, and post-process it to count how many
 images of each kind are present
Once I am doing it for displaying images and when I try the same for
similar loop for count and it comes as zero.
Please help me in here.

Thanks,
Senthil

On Thu, Mar 13, 2008 at 3:09 AM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
wrote:

I am calling named template by passing the param value 'S' and 'N'.
 > I would like to know,is there anyway to find the The No of
 > times named templated called with  'S' as value and otherwise.
 >
 > This is my named template.
 >
 >       <xsl:template name="STATUS_DETECTION">
 >               <xsl:param name="my-param" />
 >               <xsl:choose>
 >                       <xsl:when test="$my-param='S'">
 >               <img src="../img/success.png"/>
 >                       </xsl:when>
 >                       <xsl:otherwise>
 >               <img src="../img/failure.png"/>
 >                       </xsl:otherwise>
 >               </xsl:choose>
 >       </xsl:template>
 >

 What you're describing is a classic example of a side-effect, and XSLT
 doesn't do side-effects.

 The main options available are:

 (a) process the input twice, once to produce the images, once to produce the
 counts

 (b) capture the output in a variable, and post-process it to count how many
 images of each kind are present

 Michael Kay
 http://www.saxonica.com/




 --~------------------------------------------------------------------
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
 or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
 --~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--