Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
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 November 16th, 2006, 05:56 PM
Authorized User
Join Date: Oct 2004
Location: Denver, CO, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default changing numeric string to number not possible?

i have two xml nodes...

<number>2</number >
<remainder>5</remainder >
i want to concat them and then multiply the result by 20...

<xsl:variable name="rating" select="number(concat(number,'.',remainder)) * 20"/>
it's still seeing it as a string and setting "rating" = NaN. How should i approach this differently?

Old November 16th, 2006, 06:36 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

There's nothing wrong with your code as shown. Perhaps the context node isn't the parent of these two elements?

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating string is numeric? crabjoe Classic ASP Basics 1 February 20th, 2008 10:43 AM
numeric to string conversion dowens VBScript 1 May 25th, 2007 04:11 PM
Extract first numeric string blkskullwork Javascript 1 November 6th, 2006 02:37 AM
MS RS Changing Server port Number jcredk BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 2nd, 2004 03:48 AM
Changing number to words kekohchaa VS.NET 2002/2003 3 April 7th, 2004 11:27 PM

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