xsl-list
[Top] [All Lists]

[xsl] Calculating Column Total

2010-03-24 14:33:56

HI All,



I am trying to calculate the total of all the columns which I am

creating dynamically.



My XML is



<data>

<event_template sp_doctypes="Research Note, Prior Stock Report, Stock
 Report">

      <event  r_version_label="[1.0, CURRENT]" />

      <event  r_version_label="[2.0, CURRENT]" />

      </event_template>

  <event_template sp_doctypes=" Prior Stock Report, Stock Report" 


      <event  r_version_label="[1.0, CURRENT]" />

      <event  r_version_label="[2.0, CURRENT]" />

       <event  r_version_label="[1.0, CURRENT]" />

      <event  r_version_label="[2.0, CURRENT]" />

 </event_template>

 </data>



and this is the template I am using



<xsl:template name="Col_Total_Num_Mand">

         <xsl:for-each select="event_template ">

        <xsl:variable name="MandatoryDocs" select="@sp_doctypes"/>

        <xsl:variable name="StrArray" select="tokenize($MandatoryDocsStr,',')"/>

        <xsl:variable name="test" select="count($StrArray)"/>

    <xsl:value-of select="count(child::event)*$test"/>

    </xsl:for-each>

</xsl:template>



What I am trying to achieve is the total of events*(test) for all the

event_template.

I am able to do it for individual event_template but not able to add 
them all.



Thanks                                    
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1
--~------------------------------------------------------------------
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>