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 May 3rd, 2010, 08:10 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default Cannot convert number to NodeSet

Hi,

iam using below syntax in my xsl :

<xsl:variable name="x"><xsl:value-of select="sum(for $t in current-group()/C_FUNCTIONAL_TOTAL return number(translate($t, ',.', '.')))"/></xsl:variable>


and it is giving below error:

Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert number to NodeSet.

any suggestions?

Thanks
Anil
 
Old May 3rd, 2010, 08:25 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

I would certainly use
Code:
<xsl:variable name="x" select="sum(for $t in current-group()/C_FUNCTIONAL_TOTAL return number(translate($t, ',.', '.')))"/>
instead of your code but I doubt it will make a difference.
Isn't there any Oracle forum where you could ask about peculiarities of the Oracle XSLT processor?
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old May 3rd, 2010, 08:30 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Hi,


i have posted it on http://forums.oracle.com
but unfortunately iam not geting any answers :( . kindly let me know if there are any other forums.

i will try to do with your given syntax and update you


Thanks
Anil
 
Old May 3rd, 2010, 12:47 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's my understanding that Oracle implement a few selected features from XSLT 2.0 but they don't implement the full spec. Your code looks as if it work fine with a product that implements all of XSLT 2.0.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old May 4th, 2010, 08:25 AM
Authorized User
 
Join Date: Mar 2010
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Hi,

i have a small question...

iam using this syntax ..
<xsl:variable name="x"><xsl:value-of select="sum(for $t in current-group()/C_FUNCTIONAL_TOTAL return number(translate($t, ',.', '.')))"/></xsl:variable>

i guess it is giving error "Cannot convert number to NodeSet" because,
it is failing to convert the whole numbers which don't have any decimal or group seperator ( ex : 10 , 20 , 30 )
as iam using translate function may be it is expecting something like 10.00,20 to translate but getting only 10


the function translate($t, ',.', '.') is translating into US for both whole numbers and for decimal numbers in Jdeveloper
but this is not happening in Oracle Apps.

is there any way to find out the number format in C_FUNCTIONAL_TOTAL and change it US formate and then adding them ,which can works for both whole numbers and decimal seperaters.
any work around??


Thanks
anil
 
Old May 4th, 2010, 08:52 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I am sorry, I do not know why this is failing. It looks valid in XSLT 2.0 but invalid in 1.0. I don't know why it is trying to convert a number to a node-set, or why it is failing. If you can't get help from the people who support the product, I suggest you try a different product.
__________________
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
convert time field to number jobalistic Access 17 February 22nd, 2013 12:40 PM
convert nodeset to a single node newbies1234 XSLT 2 August 18th, 2008 10:01 AM
Convert date to number samirz10 Access 1 July 22nd, 2005 03:04 PM
Convert to a number ticktack Classic ASP Basics 4 February 9th, 2004 05:31 AM
How can i convert english numbers to arabic number zahidpervaiz Classic ASP Databases 0 December 30th, 2003 06:51 AM





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