xsl-list
[Top] [All Lists]

[xsl] Restrictind a set of notes to within a group

2012-04-19 09:17:45
have an xml file like
<Month>
   <Date day=”1”>
       <Session task=”task1”>
           <Notes hours-worked=”1.5”/>
       </Session>
       <Session task=”task2”>
           Notes hours-worked=”5”/>
       <Session task=”task1”>
           <Notes hours-worked=”3”/>
       </Session>
   </Date>
   <Date day=”2”>
       ....
   </Date>
</Month>
For the month, I want to sum all the hours-worked for each task:

I have tried several expressions, but failed. This gives me the total hours worked on all tasks rather than each individual task:
<xsl:for-each-group select="Date/Session" group-by="@task">
     <xsl:for-each select=".">
       <fo:block xsl:use-attribute-sets="subdiv2">
         <xsl:value-of select="@task"/>
         <xsl:text> (</xsl:text>
<xsl:value-of select="format-number(sum(../../Date/Session/Notes/@hours-worked), '.00')"/>
         <xsl:text>) </xsl:text>
       </fo:block>
   </xsl:for-each>
</xsl:for-each-group>
How do I restrict the total to just the hours-worked on each specific task?
Thanks,
Mark



--~------------------------------------------------------------------
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>