xsl-list
[Top] [All Lists]

[xsl] sum() Function Used With Variables

2007-03-14 11:15:15
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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--