xsl-list
[Top] [All Lists]

RE: the sum value. SOS.

2005-02-18 11:58:06
sum(//puntuacion_valor)

That will sum the value of every puntuacion_valor node, including the ones 
that are not children of the puntuaciones node. While it may work because 
the document happens to have only one puntuaciones node and no other node 
has children named puntuacion_valor, it will cause trouble if either of 
those conditions is not true. Also // is inefficient (as it looks at every 
node in the document). I would use

sum(puntuaciones/puntuacion_valor)

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)





Ryan Graham <ryan(_dot_)graham(_at_)apollogrp(_dot_)edu> 
02/18/2005 12:47 PM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
"'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'" 
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
cc

Subject
RE: [xsl] the sum value. SOS.







sum(//puntuacion_valor)

HTH,
RG
-----Original Message-----
From: Dionisio Ruiz de Zárate [mailto:dionisio(_at_)tinieblas(_dot_)com] 
Sent: Friday, February 18, 2005 11:43 AM
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] the sum value. SOS.


hello i have the bellow xml.
i am tring to load the sum of some nodes but i cannot load it.

i have some nodes and i wnat to load the sum value:
XML:
....
- <puntuaciones>
- <puntuacion>
   <puntuacion_valor>8</puntuacion_valor> 
  </puntuacion>
- <puntuacion>
   <puntuacion_valor>33</puntuacion_valor> 
  </puntuacion>
- <puntuacion>
   <puntuacion_valor>28</puntuacion_valor> 
  </puntuacion>
  </puntuaciones>..
...

how can i load the sum of the <puntuacion_valor> nodes?

thanks


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

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




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