Good call Michael, I used StreamSource and it work beautifully.

 

Thanks,

 

Jeff

 


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Michael Kay
Sent: Thursday, June 17, 2004 4:15 PM
To: saxon-help@lists.sourceforge.net
Subject: RE: [saxon] sum function - annotation null error

 

I think this is the same problem reported by Michael Hartmeier, and I suspect the reason that it occurs in one environment and not another is that you are using a DOMSource as the input to your transformation. (But this is conjecture.)

 

I advise against using a DOMSource unless you have very good reasons, because it is much slower. It's best to supply the transformation input as a StreamSource or SAXSource.

 

I think the failure would occur on any operation that attempts to access the typed value of a node that has been created as a copy of a node in a DOM - in your case, this is the sum() function. 

 

Michael Kay

 


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of jeff isenhart
Sent: 17 June 2004 23:42
To: saxon-help@lists.sourceforge.net
Subject: [saxon] sum function - annotation null error

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