[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

summing preceding attribute values

Subject: summing preceding attribute values
From: Louis.Masters@xxxxxxxxxxx
Date: Tue, 11 Jan 2005 08:26:34 -0500
xsl preceding attribute
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.