I am experiencing strange behavior using the sum function - fn:sum(). From a Servlet I am feeding xml to saxon and it blows up in the middle of the sum. HOWEVER, when I save the exact same xml to my hard and run it against Saxon (outside of Tomcat), the function works as advertised. When the sum function is not used everything runs great under Tomcat. Originally thought this might be a memory issues, but increasing it made no difference.

 

Using Saxon 8.0, Tomcat 4.1

 

Dump:

Unknown type annotation (NULL) in document instance

javax.xml.transform.TransformerException: Unknown type annotation (NULL) in document instance

            at net.sf.saxon.instruct.Instruction.dynamicError(Instruction.java:266)

            at net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(Instruction.java:226)

            at net.sf.saxon.instruct.SequenceInstruction.processLeavingTail(SequenceInstruction.java:147)

            at net.sf.saxon.instruct.Template.expand(Template.java:131)

            at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:79)

            at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:101)

            at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:61)

            at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:61)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:179)

            at net.sf.saxon.instruct.ExprInstruction.iterate(ExprInstruction.java:261)

            at net.sf.saxon.expr.ExpressionTool.eagerEvaluate(ExpressionTool.java:136)

            at net.sf.saxon.expr.ExpressionTool.lazyEvaluate(ExpressionTool.java:107)

            at net.sf.saxon.instruct.GeneralVariable.getSelectValue(GeneralVariable.java:210)

            at net.sf.saxon.instruct.Variable.processLeavingTail(Variable.java:32)

            at net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(Instruction.java:219)

            at net.sf.saxon.instruct.SequenceInstruction.processLeavingTail(SequenceInstruction.java:147)

            at net.sf.saxon.instruct.Template.processLeavingTail(Template.java:94)

            at net.sf.saxon.Controller.applyTemplates(Controller.java:290)

            at net.sf.saxon.Controller.defaultAction(Controller.java:318)

            at net.sf.saxon.Controller.applyTemplates(Controller.java:285)

            at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:86)

            at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:50)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(Instruction.java:219)

            at net.sf.saxon.instruct.SequenceInstruction.processLeavingTail(SequenceInstruction.java:147)

            at net.sf.saxon.instruct.Template.processLeavingTail(Template.java:94)

            at net.sf.saxon.Controller.applyTemplates(Controller.java:290)

            at net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:125)

            at net.sf.saxon.Controller.applyTemplates(Controller.java:272)

            at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:86)

            at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:50)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.process(Instruction.java:168)

            at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:188)

            at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:178)

            at net.sf.saxon.instruct.Instruction.processChildrenLeavingTail(Instruction.java:219)

            at net.sf.saxon.instruct.SequenceInstruction.processLeavingTail(SequenceInstruction.java:147)

            at net.sf.saxon.instruct.Template.processLeavingTail(Template.java:94)

            at net.sf.saxon.Controller.applyTemplates(Controller.java:293)

            at net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:125)

            at net.sf.saxon.Controller.applyTemplates(Controller.java:272)

            at net.sf.saxon.Controller.run(Controller.java:187)

            at net.sf.saxon.Controller.transformDocument(Controller.java:1543)

            at net.sf.saxon.Controller.transform(Controller.java:1349)

            .......and so on