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

Re: No of Times Named Template called

Subject: Re: No of Times Named Template called
From: "Senthilkumaravelan K" <skumaravelan@xxxxxxxxxxxxxx>
Date: Thu, 13 Mar 2008 12:24:21 -0700
Re:  No of Times Named Template called
Hi Martin,
Where do I need to capture the count. First part of the loop am
passing  String "S" and "F" to display images.
Am not sure ,where could I capture the count in my XSLT.
Could you please help me in here to show the no of "S" counts and I
can replicate the same for "F" counts.

Thanks,
Senthil



On Thu, Mar 13, 2008 at 12:13 PM, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
>
> Senthilkumaravelan K wrote:
>
>
>  >                                       <xsl:for-each select="report/result">
>  >                                               <tr>
>  >                                                       <xsl:if test="(position() mod 2 = 0)">
>  >                                                               <xsl:attribute name="bgcolor">
>  >                                                                       #FFF8C6
>  >                                                               </xsl:attribute>
>  >                                                       </xsl:if>
>  >                                                       <td>
>  >                                                               <xsl:value-of select="title" />
>  >                                                       </td>
>  >                                                       <td>
>  >                                                               <xsl:if test="req/* or req/text()">
>  > <textarea rows="$ROWS" cols="$COLS" readonly="true"
>  > onClick="alert(this.value)">
>  >                                               <xsl:if test="(position() mod 2 = 0)">
>  >                                                       <xsl:attribute name="style">background-color:   #FFF8C6</xsl:attribute>
>  >                                               </xsl:if>
>  > <xsl:copy-of select="req" />
>  > </textarea>
>  >                                                               </xsl:if>
>  >                                                       </td>
>  >                                                       <td>
>  > <textarea rows="$ROWS" cols="$COLS" >
>  >                                                                                                       <xsl:if test="(position() mod 2 = 0)">
>  >                                                       <xsl:attribute name="style">background-color:   #FFF8C6</xsl:attribute>
>  >                                               </xsl:if>
>  >                                                       <xsl:copy-of select="exp_resp" />
>  >                                                       </textarea>
>  >                                                       </td>
>  >                                                       <td>
>  > <textarea rows="$ROWS" cols="$COLS" >
>  >                                                                                                       <xsl:if test="(position() mod 2 = 0)">
>  >                                                       <xsl:attribute name="style">background-color:   #FFF8C6</xsl:attribute>
>  >                                               </xsl:if>
>  >                                                               <xsl:copy-of select="resp" />
>  >                                                               </textarea>
>  >                                                       </td>
>  >                                                       <td>
>  >                                                               <xsl:choose>
>  >                                                                       <xsl:when
>  > test="normalize-space(resp/fault)=normalize-space(exp_resp/fault)">
>  >                                                                               <xsl:call-template name="STATUS_DETECTION">
>  >                                                                                       <xsl:with-param name="my-param" select="'S'" />
>
>  Here you are passing 'S' and
>
> >                                                                               </xsl:call-template>
>  >                                                                       </xsl:when>
>  >                                                                       <xsl:otherwise>
>  >                                                                               <xsl:call-template name="STATUS_DETECTION">
>  >                                                                                       <xsl:with-param name="my-param" select="'F'" />
>
>  here 'F' but later on where you compute the count
>
> >                                                                               </xsl:call-template>
>  >                                                                       </xsl:otherwise>
>  >                                                               </xsl:choose>
>  >                                                       </td>
>  >                                               </tr>
>  >                                       </xsl:for-each>
>  >
>  >
>  >       <xsl:variable name="result">
>  >      <xsl:for-each select="report/result">
>  >               <xsl:if test="normalize-space(resp/fault)=normalize-space(exp_resp/fault)">
>  >         <xsl:call-template name="STATUS_DETECTION">
>  >            <xsl:with-param name="my-param" select="S" />
>                                                      ^^^^
>  your are not passing in a string (e.g. 'S' or 'F') but an node-set of S
>  elements. There no such elements therefore your template creates failure
>  images and then your count code does not find any and therefore the
>  count is 0.
>
>
>  --
>
>
>
>         Martin Honnen
>         http://JavaScript.FAQTs.com/

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.