[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] the sum value. SOS.


Subject: RE: [xsl] the sum value. SOS.
From: JBryant@xxxxxxxxx
Date: Fri, 18 Feb 2005 12:58:06 -0600

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.graham@xxxxxxxxxxxxx>
02/18/2005 12:47 PM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
"'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
cc

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







sum(//puntuacion_valor)

HTH,
RG
-----Original Message-----
From: Dionisio Ruiz de Zarate [mailto:dionisio@xxxxxxxxxxxxx]
Sent: Friday, February 18, 2005 11:43 AM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
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


Current Thread