After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 314338 - mathematical calculation results in "-./,),(-*," instead of NAN for xml elements that don't exist
mathematical calculation results in "-./,),(-*," instead of NAN for xml eleme...
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.14
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-24 04:38 UTC by Ryan Whitney
Modified: 2006-09-30 02:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This is an example to show that the xslt code works (292 bytes, text/plain)
2005-08-25 06:19 UTC, Ryan Whitney
Details
This is an example that will trigger the error (when no required elements exist) (80 bytes, text/plain)
2005-08-25 06:19 UTC, Ryan Whitney
Details
Here is the XSLT code to display the bug (802 bytes, text/plain)
2005-08-25 06:20 UTC, Ryan Whitney
Details

Description Ryan Whitney 2005-08-24 04:38:05 UTC
Please describe the problem:
I'm performing the following function in my XSLT:
<xsl:variable name="Goal" select="ceiling(sum(key('Records', 'Type 1')/MonthlyTotal) div count(key
('Records', 'Type 1')/MonthlyTotal))"/>

.. and when the element in question does not exist, I get the response "-./,),(-*," instead of NAN. (This 
works when the element in question exists)

Steps to reproduce:
I can provide a sample xml and xslt upon request (I cannot release the original due to NDA).  Not sure how 
to describe it with repro steps.

Actual results:
I get -./,),(-*,

Expected results:
I get NAN

Does this happen every time?
Yes

Other information:
I'm using this in an web app using the perl package XML::LibXSLT.  I'm also able to reproduce this with 
TestXSLT (http://www.macupdate.com/info.php/id/13972) when using the LibXSLT library.  When I use 
either the Sabletron, Xalan-J, or Saxon engines in TestXSLT, I get a NAN.
Comment 1 Daniel Veillard 2005-08-24 08:09:08 UTC
This is not a minor bug IMHO, a normal one.

Please attach an instance of the input file (see "Create a New Attachment" link
below).
This sounds a lot like bug #314326, strange ... 

Daniel
Comment 2 Ryan Whitney 2005-08-25 06:19:04 UTC
Created attachment 51313 [details]
This is an example to show that the xslt code works
Comment 3 Ryan Whitney 2005-08-25 06:19:48 UTC
Created attachment 51314 [details]
This is an example that will trigger the error (when no required elements exist)
Comment 4 Ryan Whitney 2005-08-25 06:20:10 UTC
Created attachment 51315 [details]
Here is the XSLT code to display the bug
Comment 5 Ryan Whitney 2005-08-25 06:22:15 UTC
Ok, so its Normal. ;)  Wasn't causing a serious issue for me, but I'll take your word for it.

I've added the necessary files.  Two xml files, one to show that the xslt equation in question does work 
and the other to display a xml with the missing required elements that triggers the bug.   These are 
dramatically reduced from the original files but should be the barest required to demonstrate the bug.
Comment 6 André Klapper 2006-09-29 18:51:08 UTC
reopening as requested information has been provided.
ryan, do you still face this issue? if so, which version are you running?
Comment 7 Ryan Whitney 2006-09-29 19:02:13 UTC
I am no longer working on the project where this issue popped up.  I just tried it on my Mac, but it looks like its running libXSLT 1.1.11 which is earlier than the version I reported the issue on.  Using my sample files below will trigger the bug though, just need to set something up that can take in the xml and perform the transform on it.  If neccessary, I could probably provide a simple perl script to do just that.

Comment 8 William M. Brack 2006-09-30 02:21:45 UTC
I confirmed that the problem was present in libxslt-1.1.14/libxml2-2.6.19 (the closest relevant versions which I had on my test system), and that the problem is fixed in libxslt-1.1.17/libxml2-2.6.26 (as well as CVSHEAD).  Accordingly, I'm closing this bug.  Thanks for your help and patience :-)