xsl-list
[Top] [All Lists]

Re: Tricky inclusion match

2005-03-29 12:07:02
On Tue, 29 Mar 2005 11:34:02 -0700, Karl Stubsjoen 
<kstubs(_at_)gmail(_dot_)com> wrote:
groupa_count and groupb_count are really the collection of results
from the match on "record".  So the result for group a might be:

<groupa_count>
  <value>1</value>
  <value>2</value>
  <value>1</value>
</groupa_count>

The sum of group a would then be:  4


Ummm...ok.  I'm a little confused because the xslt doesn't seem to
match the input you gave earlier in this thread.  Also because there
was some mention of you working with result tree fragments and not
nodesets.  That might have been a misunderstanding.

But it appears that 

<xsl:template match="record" mode="COUNT">
<xsl:value-of 
select="number(count(ancestor::recordset/record[field[(_at_)fieldname='paint']
= current()/field[(_at_)fieldname='paint']]))"/>
</xsl:template>

Returns a number, not a nodeset.  Of course, I'm pretty new to xslt.

Of the top of my head I would imagine something like 

<xsl:value-of select="sum($groupa_count/data/value)"/>

should work if it is a node set like the one you described.

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