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

Re: sum() over attributes is 0

Subject: Re: sum() over attributes is 0
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Aug 2007 20:44:49 -0300
Re:  sum() over attributes is 0
You don't mention which processor you are using but certainly the surface evidence looks like a bug.

Which tool are you using and what do you get with the following change?

<xsl:comment>
  <xsl:text>count: </xsl:text>
  <xsl:value-of select="count(//lc:container[lc:item]/@select)"/>
</xsl:comment>
<xsl:comment>
  <xsl:text>list of select attributes: </xsl:text>
  <xsl:for-each select="//lc:container[lc:item]/@select">
    <xsl:value-of select="."/>
    <xsl:text> </xsl:text>
  </xsl:for-each>
</xsl:comment>

The above will address the nodes using the same address that is being used for the sum function.

Have you tried your code with any other processors?

. . . . . . . . . . Ken

At 2007-08-21 16:33 -0700, Andreas Kemkes wrote:
I'm not having much success using the sum() function over a node set.

The following two expressions

<xsl:comment>
  <xsl:text>sum: </xsl:text>
  <xsl:value-of select="sum(//lc:container[lc:item]/@select)"/>
</xsl:comment>
<xsl:comment>
  <xsl:text>list of select attributes: </xsl:text>
  <xsl:for-each select="//lc:container[lc:item]">
    <xsl:value-of select="@select"/>
    <xsl:text> </xsl:text>
  </xsl:for-each>
</xsl:comment>

result in the following output:

    <!--sum: 0-->
    <!--list of select attributes: 2 3 1 -->

I'm not clear why the result of sum() is 0. Are there any other prerequisites that I'm missing?

Thanks again.








____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
http://mobile.yahoo.com/go?refer=1GNXIC


--
Upcoming public training: XSLT/XSL-FO Sep 10, UBL/code lists Oct 1
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.