Project

Profile

Help

NullPointerException thrown during comparison

Added by Anonymous about 14 years ago

Legacy ID: #8652582 Legacy Poster: Benny Craig (bennycraig)

Hello Saxon Team, I have a reproducible error which i believe to be a bug in your new saxon9he.jar. The error is not thrown from an older version of saxon9.jar. I'm surprised to see no option to attach here, so I resort to pasting my code. Please advise and I would be happy to e-mail you a better-formed example. I have done my best to make a minimal example, but have added a lot of comments for various cases, to save you time. input (test.xml): [code][/code] transformation (test.xsl): [code] <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"> <xsl:template match="/"> <xsl:variable name="var"> <xsl:call-template name="temp1"> <xsl:with-param name="para" select="foo[@bar='1']" /> </xsl:call-template> </xsl:variable> <xsl:value-of select="$var" /> </xsl:template> <xsl:template name="temp1"> <xsl:param name="para" /> xsl:textstuff1</xsl:text> </xsl:template> <xsl:template mode="temp2" match="node()"> <xsl:param name="para" /> xsl:textstuff2</xsl:text> </xsl:template> </xsl:stylesheet> [/code] When I apply the latter transform to the former input xml example, I receive the following error: Exception in thread "main" java.lang.NullPointerException at net.sf.saxon.expr.GeneralComparison10.compare(GeneralComparison10.java:324) at net.sf.saxon.expr.GeneralComparison10.effectiveBooleanValue(GeneralComparison10.java:264) at net.sf.saxon.expr.FilterIterator$NonNumeric.matches(FilterIterator.java:182) at net.sf.saxon.expr.FilterIterator.getNextMatchingItem(FilterIterator.java:65) at net.sf.saxon.expr.FilterIterator.next(FilterIterator.java:44) at net.sf.saxon.value.SequenceExtent.(SequenceExtent.java:98) at net.sf.saxon.value.SequenceExtent.makeSequenceExtent(SequenceExtent.java:134) at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:313) at net.sf.saxon.instruct.GeneralVariable.getSelectValue(GeneralVariable.java:378) at net.sf.saxon.instruct.Instruction.assembleParams(Instruction.java:147) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:261) at net.sf.saxon.instruct.Instruction.iterate(Instruction.java:328) at net.sf.saxon.expr.Atomizer.iterate(Atomizer.java:180) at net.sf.saxon.expr.UntypedAtomicConverter.iterate(UntypedAtomicConverter.java:165) at net.sf.saxon.expr.ItemChecker.iterate(ItemChecker.java:132) at net.sf.saxon.functions.StringJoin.evaluateItem(StringJoin.java:48) at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:316) at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:246) at net.sf.saxon.instruct.Instruction.process(Instruction.java:93) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301) at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:229) at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:354) at net.sf.saxon.Controller.transformDocument(Controller.java:1849) at net.sf.saxon.Controller.transform(Controller.java:1700) at test.Test.main(Test.java:13) Thank you guys (in particular Mr. Kay) for the poweful library and priceless forum contributions. Cheers, -Ben


Replies (1)

RE: NullPointerException thrown during comparison - Added by Anonymous about 14 years ago

Legacy ID: #8652674 Legacy Poster: Benny Craig (bennycraig)

Please pardon the extraneous semicolon in the opening element of the stylesheet, and also note the error persists using xsl version 1.0 as well.

    (1-1/1)

    Please register to reply