Thanks for reporting it. I can't download from the URL specified - the MIME
type causes WinZIP to start up, but WinZIP doesn't like the file.
But for once the bug is actually evident from the stack-trace alone - a
really simple one; it happens when you convert a non-empty string consisting
entirely of whitespace to a number. I've managed to reproduce it {test
math-two18}.
It shouldn't fail here, it should give you a NaN value. But it's probably an
error in your logic (or in your data) if you're trying to convert a
whitespace string to a number.
Michael Kay
> -----Original Message-----
> From: saxon-help-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> [mailto:saxon-help-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx]
> On Behalf Of
> Ben Trafford
> Sent: 30 November 2003 15:42
> To: saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> Subject: [saxon] String out of bounds error.
>
>
>
> (I've just copied something I also posted to the Help forum)
>
> I got the following error, and have no idea why. Any
> help would be
> appreciated.
>
> java.lang.StringIndexOutOfBoundsException: String index out
> of range: 80 at java.lang.String.charAt(Unknown Source) at
> net.sf.saxon.value.Value.trimWhitespace(Value.java:189)
> at net.sf.saxon.value.Value.stringToNumber(Value.java:82)
> at net.sf.saxon.value.StringValue.convert(StringValue.java:87)
> at
> net.sf.saxon.value.UntypedAtomicValue.convert(UntypedAtomicVal
> ue.java:54)
> at
> net.sf.saxon.expr.ArithmeticExpression$NumericArithmetic.evalu
> ateItem(ArithmeticExpressio
> n.java:314)
> at
> net.sf.saxon.expr.ArithmeticExpression.evaluateItem(Arithmetic
> Expression.java:251)
> at
> net.sf.saxon.expr.AtomicSequenceConverter.evaluateItem(AtomicS
> equenceConverter.java:91)
> at
> net.sf.saxon.expr.ComputedExpression.evaluateAsString(Computed
> Expression.java:283)
> at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:88)
> at net.sf.saxon.instruct.Instruction.process(Instruction.java:152)
> at
> net.sf.saxon.instruct.Instruction.processChildren(Instruction.
> java:194)
> at
> net.sf.saxon.instruct.SimpleNodeConstructor.expandChildren(Sim
> pleNodeConstructor.java:91)
>
> at
> net.sf.saxon.instruct.FixedAttribute.processLeavingTail(FixedA
> ttribute.java:139)
> at net.sf.saxon.instruct.Instruction.process(Instruction.java:152)
> at
> net.sf.saxon.instruct.Instruction.processChildren(Instruction.
> java:194)
> at
> net.sf.saxon.instruct.FixedElement.processLeavingTail(FixedEle
> ment.java:128)
> at
> net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(I
> nstruction.java:261)
> at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:92)
> at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:61)
> at net.sf.saxon.instruct.Instruction.process(Instruction.java:152)
> at
> net.sf.saxon.instruct.Instruction.processChildren(Instruction.
> java:194)
> at
> net.sf.saxon.instruct.FixedElement.processLeavingTail(FixedEle
> ment.java:128)
> at
> net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(I
> nstruction.java:261)
> at
> net.sf.saxon.instruct.Sequence.processLeavingTail(Sequence.java:144)
> at net.sf.saxon.instruct.Template.expand(Template.java:105)
> at net.sf.saxon.instruct.Template.processLeavingTail(Template.java:74)
> at net.sf.saxon.Controller.applyTemplates(Controller.java:326)
> at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:140)
> at
> net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:76)
> at
> net.sf.saxon.instruct.Instruction.processChildren(Instruction.
> java:194)
> at
> net.sf.saxon.instruct.FixedElement.processLeavingTail(FixedEle
> ment.java:128)
> at
> net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(I
> nstruction.java:261)
> at
> net.sf.saxon.instruct.Sequence.processLeavingTail(Sequence.java:144)
> at net.sf.saxon.instruct.Template.expand(Template.java:105)
> at net.sf.saxon.instruct.Template.processLeavingTail(Template.java:74)
> at net.sf.saxon.Controller.applyTemplates(Controller.java:329)
> at net.sf.saxon.Controller.defaultAction(Controller.java:354)
> at net.sf.saxon.Controller.applyTemplates(Controller.java:321)
> at net.sf.saxon.Controller.run(Controller.java:210)
> at net.sf.saxon.Controller.transformDocument(Controller.java:1599)
> at net.sf.saxon.Controller.transform(Controller.java:1417)
> at net.sf.saxon.Transform.processFile(Transform.java:688)
> at net.sf.saxon.Transform.doMain(Transform.java:394)
> at net.sf.saxon.Transform.main(Transform.java:67)
> Fatal error during transformation: String index out of range: 80
>
> I'm using Saxon 7.8 on Windows 2000 SP4, with JDK 1.4.1_02.
>
> The files that produced this error are here:
>
http://www.prodigal.ca/broken.tar.gz
--->Ben Trafford
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does
SourceForge.net help you be more productive? Does it help you create better
code? SHARE THE LOVE, and help us help YOU! Click Here:
http://sourceforge.net/donate/
_______________________________________________
saxon-help mailing list
saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/saxon-help
<<attachment: winmail.dat>>
|