[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Compute sum of a computed node list
> -----Original Message----- > From: vsubramanian@xxxxxxxxxx [mailto:vsubramanian@xxxxxxxxxx] > > Hi! > > Here I am trying to compute the sum for the state > local salary which has some mathematical calculation involved. > > When i compute sum of a node which is not mathematically altered, > i get the sum despite having a NaN as one of the nodes. > but, this gives me an error. > Could you please be kind enough to explain this? > Hi, I'm not sure I understand your problem fully, however, I'm wondering whether you realize that over here ... > <state_local_match_total> > <xsl:value-of select="format-number( sum(rehab/state_local_match[ number(.)=number(.)]),'###,###.##','MyFormat')"/> > </state_local_match_total> the XPath predicate is particularly intriguing, as the specified condition 'number(.)=number(.)' will always be true (all nodes for which it is true that their content, when converted to a number, equals their own content converted to a number) Might you be looking for 'number(.)=number(current())'? If not, then IMHO it means nothing, and could as well be left out. Greetz, Andreas
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|