xsl-list
[Top] [All Lists]

Re: [xsl] sum of attribute values

2006-05-31 16:49:18

in xpath2 you can go
sum(col/@width/number(substring-before(.,'in')))
but if using xslt1 you need to either first do a transform that copies
the nodes but removes the in then use sum(xx:node-set($x)/col/@width)
or use a recursive named template that accumulates the sum "by hand"
rather than using the sum function. (The FXSL library will have lots of
these should you not choose to write one yourself)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>