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

[xsl] summing preceding attribute values


Subject: [xsl] summing preceding attribute values
From: Louis.Masters@xxxxxxxxxxx
Date: Tue, 11 Jan 2005 08:26:34 -0500

I have the following layout:

<row>
  <cell span='2'>
    Foo1
  </cell>
  <cell span='3'>
    Foo2
  </cell>
  <cell span='4'>
    Foo3
  </cell>
</row>

Within the <row>, on any given cell, I need to know the sum of the span
attributes on the preceding cells.  For example, when I am in the "Foo3"
cell, I need to know that the previous span count is 5.

I am trying different combinations of sum, but can only get the immediately
preceding span and not the sum of all preceding spans.  I am using
something like:

<xsl:value-of select="sum(preceding-sibling::cell[@span]/ @span)"/>

This does not work.  Any ideas on what I am doing wrong?

-Lou

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the content,
the information contained herein is privileged and confidential
information/work product. The communication is intended for the use of the
individual or entity named above.  If the reader of this transmission is
not the intended recipient, you are  hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.  If you have received this communication in error, please
notify the sender immediately by telephone (732-758-6800) or by electronic
mail (postmaster@xxxxxxxxxxx), and destroy any copies, electronic, paper or
otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Current Thread