xsl-list
[Top] [All Lists]

Re: [xsl] No of Times Named Template called

2008-03-13 13:17:35
Hi ,
I have got it working now. Thanks you very much for all your help.

Thanks,
Senthil

On Thu, Mar 13, 2008 at 12:24 PM, Senthilkumaravelan K
<skumaravelan(_at_)googlemail(_dot_)com> wrote:
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(_dot_)Honnen(_at_)gmx(_dot_)de> 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/
 >
 >  --~------------------------------------------------------------------
 >  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>
--~--

<Prev in Thread] Current Thread [Next in Thread>