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

Re: sum() Function Used With Variables

Subject: Re: sum() Function Used With Variables
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Wed, 14 Mar 2007 13:10:18 -0700
Re:  sum() Function Used With Variables
Use the

f:transform-and-sum()

function of FXSL.


For examples do have a look in the tests directory or perform a search for


transform-and-sum



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play


On 3/14/07, Ryan Lubben <ryanl@xxxxxxxxxxx> wrote:
Hi All,

I am currently attempting to use the sum() function in XSLT 1.0 to total up
various table column widths in order to determine whether or not the table
needs to span the entire width of the page. Unfortunately, the column width
attribute that exists in the XML has the inches designator included in the
width value.  I have set my stylesheet up so that the 'in' designator is
filtered through another variable using the substring-before() function, but
as soon as I attempt to use the sum() function with the first variable my
stylesheet bottoms out.  Any help would be greatly appreciated.

<xsl:param name="colwidths">
       <xsl:choose>
               <xsl:when test="contains(tgroup/colspec/@colwidth, 'in')">
                       <xsl:value-of
select="substring-before(tgroup/colspec/@colwidth,'in')"/>
               </xsl:when>
               <xsl:otherwise>0</xsl:otherwise>
       </xsl:choose>
</xsl:param>

<xsl:param name="sum.colwidths" select="sum($colwidths)"/>


Thanks in advance.


Ryan Lubben

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.