View Single Post
  #1 (permalink)  
Old June 23rd, 2006, 03:36 PM
tslag tslag is offline
Authorized User
Join Date: Jun 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sum function and XPath problems

Ok, sorry for all the posts, but this is very hard for me to get for some reason. I want to sum several dozen values and present them, but the sum function is returning very small numbers, perhaps just the first number it comes to. Again, I think this is from my grouping troubles. Here is the code:
source file:



Where there are hundreds of <pavement...> nodes and several different <Inspected_x0020z_Use> values.
and the xsl file:
<xsl:stylesheet version="2.0" xmlns:xsl="">
<xsl:output indent="yes"/>
<xsl:template match="dataroot">
<main caption="Table Title" headertextfont="Arial" headertextcolor="0xFFFFFF" rowtextfont="Arial" rowtextcolor="0x000000" headercolor="0x5372aa" rowcolor="0xFFFFFF" altrowcolor="0xcccccc">

    <xsl:for-each-group select="pavement_x0020_Conditions" group-by="Inspected_x0020_Use">
      <xsl:sort select="Inspected_x0020_Use"/>
    <Use><xsl:value-of select="Inspected_x0020_Use"/></Use>
    <Area><xsl:value-of select="sum(current-group()/Inspected_x0020_Area)"/></Area>
I need to get the area of each Inspected Use, of which there are several types. I used a method very similar to what was suggested in my previous post, and it doesn't seem to add anything. I think I am just pointing at the wrong thing. Any ideas?
Reply With Quote