Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Software (http://www.velocityreviews.com/forums/f6-software.html)
-   -   how to sum in XSL (http://www.velocityreviews.com/forums/t376111-how-to-sum-in-xsl.html)

tintrung 11-13-2006 07:20 PM

how to sum in XSL
 
Hello All
i have XML file
<?xml version="1.0"?>
<DMD>
<ROW_DETAIL>
<NAME>Name 1</NAME>
<VALUE1>5</VALUE1>
<VALUE2>7</VALUE2>
</ROW_DETAIL>
<ROW_DETAIL>
<NAME>Name2</NAME>
<VALUE1>10</VALUE1>
<VALUE2>2</VALUE2>
</ROW_DETAIL>
<ROW_DETAIL>
<NAME>Name 3</NAME>
<VALUE1>20</VALUE1>
<VALUE2>1</VALUE2>
</ROW_DETAIL>
</DMD>

and want to show in screen as
result look like
NAME VALUE1 VALUE2
Name 1 0 2
Name 2 8 0
name 3 19 0
SUM: 27 2

the method:
for each-record, if value of VALUE1 > VALUE2, then result = VALUE1-VALUE2 and column 2 will be set = 0. and if VALUE2 > VALUE1, then result = VALUE2-VALUE1 and column 1 will be set = 0

after that, the end of loop. sum value for column.

Please help me make file XSL
Thanks


All times are GMT. The time now is 08:32 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.