DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24246>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24246 The number() function fails Summary: The number() function fails Product: XalanJ2 Version: 2.5 Platform: PC OS/Version: Windows XP Status: NEW Severity: Major Priority: Other Component: org.apache.xpath AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] For example if we try number(' ') (all spaces), the following happens: public double toDouble() { if(m_length == 0) return Double.NaN; int i; char c; String valueString = fsb().getString(m_start,m_length); for (i=0;i<m_length;i++) if (!XMLCharacterRecognizer.isWhiteSpace(valueString.charAt(i))) break; if (valueString.charAt(i) == '-') <---------Fails here with a StringIndexOutOfBoundsException i++; ..... } An easy solution is to catch the StringIndexOutOfBoundsException and return in that case Double.NaN. Note: this error has been detected in version 2.5.1, but appears to be also in 2.5.2
