GNOME Bugzilla – Bug 314338
mathematical calculation results in "-./,),(-*," instead of NAN for xml elements that don't exist
Last modified: 2006-09-30 02:21:45 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.
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
Created attachment 51313 [details] This is an example to show that the xslt code works
Created attachment 51314 [details] This is an example that will trigger the error (when no required elements exist)
Created attachment 51315 [details] Here is the XSLT code to display the bug
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.
reopening as requested information has been provided. ryan, do you still face this issue? if so, which version are you running?
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.
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 :-)