Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2012, 06:10 AM
Authorized User
 
Join Date: Feb 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default Sum of Translate function

Hello All,

For the below code , I am getting values correctly. But I want to add all the values (sum of the values)

<xsl:for-each select="$MyNodes">
<xsl:if test="starts-with(string(@MyField), 'test')">
<br/>
<xsl:value-of select="translate(string(@MyField),(translate(stri ng(@MyField),'012345678','')),'')" />
</xsl:if>
</xsl:for-each>

Thanks
__________________
tq98
 
Old March 2nd, 2012, 07:49 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please see

http://www.biglist.com/lists/xsl-lis.../msg00968.html

This kind of thing is much easier in XSLT 2.0.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using translate function on Word document data IronStar XSLT 3 March 20th, 2011 01:33 PM
sum and translate in XPath nwright BOOK: XSLT Programmer's Reference, 2nd Edition 2 December 5th, 2008 08:20 AM
TRANSLATE FUNCTION INSIDE XPATH pallone XSLT 8 February 8th, 2008 05:30 PM
sum() function felixm_jr Reporting Services 1 April 22nd, 2007 01:59 AM
SUM Function jmss66 Classic ASP Basics 17 July 29th, 2003 08:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.