[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Tricky inclusion match

Subject: Re: Tricky inclusion match
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Tue, 29 Mar 2005 13:07:02 -0600
Re:  Tricky inclusion match
On Tue, 29 Mar 2005 11:34:02 -0700, Karl Stubsjoen <kstubs@xxxxxxxxx> 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[@fieldname='paint']
> = current()/field[@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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.