how to sum in XSL

Discussion in 'Software' started by tintrung, Nov 13, 2006.

  1. tintrung

    tintrung

    Joined:
    Nov 13, 2006
    Messages:
    1
    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
     
    tintrung, Nov 13, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. richasharma
    Replies:
    0
    Views:
    970
    richasharma
    Dec 26, 2007
  2. univbgp102@gmail.com
    Replies:
    1
    Views:
    417
    gnu / linux
    May 22, 2008
  3. univbgp102@gmail.com
    Replies:
    0
    Views:
    543
    univbgp102@gmail.com
    May 20, 2008
  4. Dhanabal
    Replies:
    0
    Views:
    388
    Dhanabal
    May 28, 2008
  5. Liam

    XML /// XSL in 305

    Liam, Feb 8, 2005, in forum: MCAD
    Replies:
    0
    Views:
    281
Loading...

Share This Page